Linux Kernel Defence Map
github.com
github.com
It is then a chicken-and-egg problem when software fails in secure environments, those failures are not reported/fixed upstream but circumvented, and consequently security cannot be enabled across the board because tools break.
I'd be curious if open source software would become more robust if by default the popular CI systems would enable features that do not cause any false positives but cause crashes in buggy software (memory randomization and read guards, compiler flags for detecting stack overflows).
PaX should be included, but afaik a lot of what PaX has been doing over the years is being/has been included in mainline.
If your company needs to write drivers for some hardware you produce, there are often specific subsystems to target with have their own maintainers and documentation.
Where things get really ugly is when a company decides to cook their own linux platform and they change tons of stuff without always understanding what they are doing.
I guess early android would be a good example of that...
I still find that even Linux based OSes like Ubuntu crash at least once a month or so. I've had to boot into initrd and manually do fsck on my laptop once this year. I'm not a software guy but I assume the reason for all this crappiness (windows as well) is because of all the patents on operating system stuff by Microsoft and Google. I'm saying this slightly tongue in cheek beacuse as a display guy I frequently see software people say display technologies suck because of all the patents so I assume that's what they experience in their own industry?
I'd be up to my neck with more work if it was generally true.
When's the last time you saw a server crash because of a bug in VFS, memory management, or such?
I find the approach taken by this map interesting. I've attempted before to categorize attacks and defenses in terms of graphs, there's interesting opportunities to improve defender's abilities to better understand attack surface, contextualize CVEs (is this exploitable in my env?), etc.
Example: anything that directly accesses MMU or caches.
IO, assembly and interrupts are much harder.
There's two ways I can interpret "the unit test".
1) "How would you create a mock object for modifying the memory layout of the code being tested?" That's just a routine that shuffles around some bytes. Or marks parts of the address space to fault so it can simulate the contents.
2) "How would you create a mock object for modifying the memory layout of the code performing the test?" That wouldn't be a test. The code performing the test isn't inside its own simulation.
The MMU is just a simple 3way array lookup, as a Unicode table.
Creating a mock is still better than not creating a mock to test against. With the mock you can create simulations, unit tests, coverage tests, static tests, formal verification.
Without mock you can just test on actual HW a few selected test scenarios you think of.
Emulation: The lack of qemu support for arm chips is mindboggling. avr/atmel is quite good in contrast. renode is far better.
You did not understand what i wrote. With hardware, its just damn difficult to get accurate mocks. If the mock is wrong, all tests relying on it are not meaningful.
If you ask me, QEMU doesn't even properly support emulating x86. Its just "good enough" to run common operating systems. You could try improving the support, maybe then you will realize how just damn difficult and undocumented this shit is, and you would understand why nobody wants to hear your crappy unit test evangelism.
Of course you have to patch qemu, gdb, renode and valgrind if something is missing. Eg the recent apple M1. But this is only needed for emulation, and we are talking simulation here.
That doesn't sound true at all tbh. I would imagine a huge amount of code is just generalized data structures and algorithms. I doubt many CVEs (<1%) rely on an accurate model of the underlying hardware.
Testing, coverage, static analysis, methodologies, etc... are a way to make prevent things from going wrong in the first place, defenses are here to protect you if things go wrong. We need both.
The article focuses only on the "defense" part, the development practices could make another article.
Note that testing and defenses can go together: test to make sure all paths are taken before shipping, and see if defenses trigger. Fuzzing in particular takes that approach.