3 ms·
Pity to see this downvoted because it is a valid point. We are stuck in the past with these macro kernels and this sort of thing is a direct consequence of usin
by jacquesm 4y ago
Pity to see this downvoted because it is a valid point. We are stuck in the past with these macro kernels and this sort of thing is a direct consequence of using them. If anything having a macro kernel makes it quite hard to shut down a module like this to determine if it was well behaved with respect to memory and because it is in the kernel any kind of compromise immediately has far reaching consequences because it breaches all of the barriers in one fell swoop.
- yjftsjthsd-h 4y ago> If anything having a macro kernel makes it quite hard to shut down a module like this to determine if it was well behaved with respect to memory Unloading modules is generally possible, but I'm not quite following what shutting it down has to do with checking memory use?
- jacquesm 4y agoUse-after-free bugs are pretty easy to figure out on shutdown because you can free the remainder of your working memory and if it turns out that you have a use-after-free there likely will be a double free in there somewhere. If not then the problem is more insidious but I've found plenty of use-after-free bugs that way.
- Sirened 4y agoMost exploited UAFs don't happen in common execution paths. They're often caused by weird races and error conditions that nobody considered to even happen. It's why things like production ASan is a lot less valuable than people would imagine: most reasonably well tested software doesn't exhibit memory corruption when used normally. So, sure, your suggested technique could be a cool way to try and catch bugs that appear under normal execution but it won't put that much of a dent in the total number of bugs.
- jacquesm 4y agoThat may well be true, even so debugging a kernel module is quite a lot harder than a regular process so the fact that it is a kernel module by itself probably increases the chances of such bugs being present. Especially because you are not in control of the execution context.
- rwmj 4y agoValgrind too - only applicable to userspace processes and it would have caught this UAF.