Re:Towards Linux Kernel Memory Safety
by pcwalton on Thursday November 16, 2017 @02:09PM
(#15715524)
I read the Cyclone papers when I designed the original Rust borrow checker, and we spoke to Dan Grossman.
Cyclone only works because it uses garbage collection for the heap. There is a uniqueness extension, but it is limited compared to what Rust can do. (See Grossman's "Existential Types for Imperative Languages" presentation for details.) The uniqueness extension was not designed to (and is not flexible enough to) supplant the garbage collector in most real-world projects.
This theoretical static checker for C code would not be compatible with virtually any existing C code in the wild, and so it would be effectively a new language.
Only works if 100% of the code is available, thus not usable by companies selling commercial libraries.
Re:Towards Linux Kernel Memory Safety
by jcelerier on Thursday November 16, 2017 @05:31AM
(#15711583)
That's not really relevant when talking about the linux kernel, though, is it ? There's tons and tons of open-source code that could just run clang-analyze today and eliminate swathes of memory bugs.
Sure it is, starting by the GPU drivers.
Static checker can work in principle on binary code. Alternatively, one can annotate API the library provides for the static checker. This is especially feasible with C where API types and usage is typically rather simple. Clearly, this implies trusting API to be implemented correctly or at least using the static checker to prove that memory-safety bugs are originated in the library, not in the application code.
[1] - https://cyclone.thelanguage.org/