25 ms·
Linux Kernel Use-After-Free Remote Code Execution Vulnerability
- micaksica 10y agoWhat happened to make this updated? This was patched in March upstream, and it appears it made it into an Android patch release a couple of days ago. [1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34b88a68f26a75e4fded796f1a49c40f82234b7d http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.g... [2] https://source.android.com/security/bulletin/2016-10-01.html https://source.android.com/security/bulletin/2016-10-01.html
- DiabloD3 10y agohttps://source.android.com/security/bulletin/2016-10-01.html#remote-code-execution-vulnerability-in-kernel-networking-subsystem https://source.android.com/security/bulletin/2016-10-01.html... Better URL that goes right to the appropriate section.
- startling 10y agoIt was fixed, but not (publicly) recognized as a security issue, so likely not backported + updated by distros in "stable" channels.
- IgorPartola 10y agoObligatory comment so nobody else has to: C is a terrible language for security and we must abandon it immediately. Anyone that uses it has clearly not heard of Go/Rust/Haskell. We should just abandon the Linux kernel and start from scratch. And we can unit test the shit out of it to avoid security vulnerabilities. Hasn't Heartbleed taught us anything? MongoDB is web scale. Ron Paul 2012.
- deleted 10y ago[deleted]
- mperham 10y agoAM I BEING DETAINED, OFFICER? AM I FREE TO GO?
- qwertyuiop924 10y agoThe sarcasm is strong with this one...
- sidlls 10y agoIn fairness I haven't seen anyone make a serious comment like yours yet in this thread.
- caconym_ 10y ago"in b4 'we should rewrite W in X/Y/Z'" has become the new "we should rewrite W in X/Y/Z".
- kardashian007 10y agoI didnt up/down vote, but rewriting in something like a performant, secure subset of Go/Rust/X and formally-proving correctness to remove many classes of errors would arguably have immense net value greater than the pain and cost of progressive/gradual rewriting migration from C to something with fewer dangerous corners and far less code to accomplish the same system behavior.
- caconym_ 10y agoI don't mean to show support for either the "rewrite everything in X/Y/Z" crowd or the "C is all we need forever" crowd (or their non-straw-man equivalents). I just thought the early state of the comments in this thread was funny, is all.
- SFJulie 10y agokernel security and later mongodb appearing randomly in a comment is like priesthood and pedophilia randomly associated. It stings of irony.
- oldmanjay 10y agoThe defensive tone of this comment is unseemly. C is just a tool, and I assure you, one that feels nothing for you.
- IgorPartola 10y agoI love me some C. Some of the funniest projects I have worked on have been written in C. My comment was sarcastic.
- deleted 10y ago[deleted]
- qb45 10y agoYou should have mentioned the official plan of a complete rewrite as a microkernel in message-passing dialect of Visual Basic, which was supposed to land in version 3.0. https://lkml.org/lkml/2005/3/2/247 https://lkml.org/lkml/2005/3/2/247
- tome 10y agooldmanjay did realise that ...
- nine_k 10y agoGo, unlikely. It's safer but it has other problems. Haskell is great but it's runtime makes it hard (though not impossible) to use in kernel development. Rust and ATS seem to be pretty well suited. With Rust getting more and more traction, maybe not all is lost :)
- smsm42 10y agoI have extremely hard time believing there can be a viable OS kernel project on Haskell. I mean, yeah, you probably can write OS kernel in Haskell, if you are determined enough. But I don't believe you can make it into a viable project. Rust - maybe, if you can get enough mindshare. Which is also a big if so far...
- bluejekyll 10y agoI think Rust has the mindshare, what it needs is people actually doing it. Redox is a ground up OS, but I wonder if we shouldn't instead be taking more of an Oxidization approach where we rewrite more and more pieces of an existing OS in Rust piecemeal. This would add some overhead (programmatically not instructionwise) of a lot of context switches though between the C and the Rust code, which is to say it would be a little ugly for a while. It might be cleaner to go after a microkernel to do this though, like L4 or rumprun.
- rbanffy 10y agoMkLinux was a popular environment on a portal I worked for in the late 90s. We brought dozens of Macs back into active duty as secondary workstations for the operations team.
- smsm42 10y ago> I think Rust has the mindshare, what it needs is people actually doing it. That's kind of the opposite of having the mindshare, IMO :) Having the mindshare means people would be reaching for it when they need things done, not have to be dragged in, and there's a wide pool of people knowing it. I'm pretty sure you can write OS kernel in almost any language that can be compiled into runnable code, and probably if you are really determined also in those that are compiled into bytecode. As I said, it's not the main issue. Unless you are a titan of programming that can do an OS project all by yourself, or have more money than Google, you'll need random people to come to the project, pick up pieces and work on them. The question is, does Rust have pool of people wide enough so that probability of people wanting to work on your project is higher than your needs? C definitely has a huge pool. So do C++, Java, JS, Python and many other languages. Rust? I'm not sure it does so far. Maybe I'm wrong.
- kardashian007 10y agoSeriously, two things: formal verification of correctness is sorely needed and a language platform which has complete, bidirectional C interoperability in targeting both kernel- and user-land which can be gradually migrated to one compilation unit a time and has much more safety, is more succinct, has C feature parity and no/minimal runtime performance hit would be requirements for candidates to change languages, but only after impressing Linus, lieutenants and contributors of undeniable value. See also: seL4, Isabelle/Coq, Idris
- zzzcpan 10y agoI disagree. It is possible to put some real effort into the compiler making the same C code safe against such problems without infinitely expensive rewrites.
- johncolanduoni 10y agoTools like this for C already exist, and have existed for some time. They've failed to reach fixation, even in security-critical areas like kernels. If that is going to be the answer, then a different approach to making C safer is definitely required.
- duneroadrunner 10y agoMight I suggest SaferCPlusPlus [1] as the "different approach". SaferCPlusPlus is a memory safe subset of C++. But the key is that the C++ preprocessor is now powerful enough to enable the creation of compatible safe substitutes for the unsafe C/C++ elements. (Native pointers in particular of course.) So rather than rewriting all your code, translating from traditional C/C++ to SaferCPlusPlus can be just a glorified "find and replace" exercise. (Well, maybe a little more than that, but not much.) I think solutions that don't require any code modification like Softbound and SAFEcode (and even the LLVM sanitizers) aren't popular because the resulting executables are quite slow. Whereas SaferCPlusPlus strives for minimal performance penalty. (Perhaps with some cooperation from C/C++'s formidable optimizing compilers.) (Btw, if it's not already clear, this is a shameless plug.) And not only is conversion to SaferCPlusPlus far less effort than rewriting everything in another memory safe language, it can be done completely incrementally. What language has better "bidirectional C interoperability" than C++? [1] https://github.com/duneroadrunner/SaferCPlusPlus https://github.com/duneroadrunner/SaferCPlusPlus
- olalonde 10y agoYou had me until "MongoDB".
- notalaser 10y agoTo be fair, there are a lot of places in the Linux kernel where primitive storage methods are used. In USB drivers, Vendor ID - Product ID pairs are stored in arrays. It's terrible and, most important, it doesn't scale. Being able to SELECT on a given VID would be really useful -- and it's really cool that MongoDB doesn't really impose too many constraints on the structure of your data. Look, this hasn't been a good day so far, okay?
- Hydraulix989 10y agoIf anything, security vulnerabilities are precisely the kind of bugs that easily sneak by unit tests.
- drvdevd 10y agoI propose a new name: a dijkstranbug. Kinda like a heisenbug except specifically for unit tests.
- IgorPartola 10y agoTry reading my comment in the most sarcastic tone you can manage. Unit testing for security vulnerabilities has been discussed to death on HN and is generally agreed that it doesn't work. Yet, every time there is any kind of vulnerability, a comment like mine shows up, except in ernest.
- qwertyuiop924 10y agoNo. Stop it. I don't want to hear that we should be re-writing all of our systems code in Rust, or that Oberon and the Wirth family should have won, or that C is crap, and Linux should die, and be re-written, or that this wouldn't have happened if we had all just adopted the Lisp Machine. We've all heard it already, we all know what you'll say. So skip the smug post, and go do something productive. Like writing a really cool piece of new code, or fixing a use-after-free, or posting something more insightful, or inventing a new type of shoelace that doesn't come untied until you want it to.
- nine_k 10y agoInstead of fixing a particular use-after-free, how about making use-after-free impossible?
- walter_bishop 10y ago> Instead of fixing a particular use-after-free, how about making use-after-free impossible? Yes .. Does this vulnerability work only on a particular architecture?
- mark4o 10y agoThe bug is architecture independent, although a particular exploit may work only on a specific architecture.
- otterley 10y agoAt what cost to performance? Very rarely are there solutions that exist without tradeoffs.
- johncolanduoni 10y agoMany verification systems can understand virtually any proof you can throw at them, so any memory management scheme for which you have a rigorous argument for correctness should be able to operate with no additional runtime overhead. And if you don't have such an argument, you've already lost no matter what language you use.
- deleted 10y ago[deleted]
- Animats 10y agoIsn't the Linux kernel tested with a zeroing storage allocator?
- caf 10y agoYes (actually, a poisoning allocator which is the moral equivalent). This bug was found because a KASAN ( https://www.kernel.org/doc/Documentation/kasan.txt https://www.kernel.org/doc/Documentation/kasan.txt ) assertion triggered during fuzzing.
- mkj 10y agoWhat circumstances are needed for this to be exploitable? Wondering if iptables could mitigate for systems where upgrading the kernel is non-trivial.
- zzzcpan 10y agoHaven't looked at this too closely, but iptables are unlikely to help. The bug appears to be in the recvmmsg() syscall, which is where the packet leaves the kernel and enters the userspace. The syscall itself is not that widely used, only for some unusually optimized UDP servers, you are unlikely to have one running. But you can check with strace just to be sure.
- mkj 10y agoYep. Though I assume this needs some interesting network traffic to trigger it.
- caf 10y agohttps://codesearch.debian.net/search?q=[^_]recvmmsg\%28[^\%29]&perpkg=1&page=1 https://codesearch.debian.net/search?q=[^_]recvmmsg\%28[^\%2... (Many of the results are for code like language runtimes and debugging tools that don't actually use recvmmsg() themselves)
- ajb 10y agoOuch, it's in chromium though.
- startling 10y agoI wrote a bit about it: https://blog.lizzie.io/notes-about-cve-2016-7117.html https://blog.lizzie.io/notes-about-cve-2016-7117.html tl;dr looks like it'd function well a local privilege exploit. not an expert, but as a remote exploit think it would need 1) a service running recvmmsg (which is kind of unlikely) 2) a way to cause recvmsg to error, and 3) a way to cause the service to close its socket in the middle of the recvmmsg call.
- astrodust 10y agoSo what can one do about this? What amount of panic is appropriate?
- kardashian007 10y agoDelpoyed boxes: ksplice / kpatch or run updates when available. And consider mitigations at various tech stack layers.
- AstralStorm 10y agoI haven't found a way to patch a kernel with nontrivial modules without kernel restart. This makes the mechanism only useful to reduce system reboot times after a patch.
- TheDong 10y agoEDIT: do not panic as much, nvm, this is in `recvmmsg` not `recvmsg`, which is not used by much software. Definitely not sshd or nginx. I can't find any software I have installed that does. I think the best advice is not to listen to anyone on HN about this shit except for cperciva Original response: ---- Reimage everything from scratch if you're a bit paranoid, because in theory someone could have rooted every server running any internet-accessible thing (even just sshd or nginx) Realistically, update ASAP and figure out from other sources how difficult this is to exploit and how likely it is that anyone actually did get a working RCE
- dlmetcalf 10y agoI wonder whether the hardened allocator on CopperheadOS helps mitigate this. The project has certainly detected plenty of UAFs in Android. https://copperhead.co/android/docs/technical_overview#hardened-allocator https://copperhead.co/android/docs/technical_overview#harden...
- bitzun 10y agoCan anyone post some of the details here or provide another link that has more details than The Register? securityfocus isn't loading for me.
- startling 10y agoI couldn't find anything, so I wrote some https://blog.lizzie.io/notes-about-cve-2016-7117.html https://blog.lizzie.io/notes-about-cve-2016-7117.html
- sargun 10y agoWebsite seems to be down. For those that are curious, it's CVE-2016-7117. Mitre link: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-7117 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-7117
- caf 10y agoThe commit for the fix is more interesting. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34b88a68f26a75e4fded796f1a49c40f82234b7d https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux....
- HerrMonnezza 10y agoAt the moment, the link you posted says "This candidate has been reserved by an organization or individual that will use it when announcing a new security problem." I guess the post on securityfocus (also not reachable) slipped out before end of embargo time?
- fulafel 10y agoHere's my attempt at a constructive idea, inspired by all the preemptive C comments: The l-k devs and the big commercial Linux vendors/users (Google, IBM, Red Hat, Amazon etc) should gang up and start offering big bounties for these. And simultaenously start doing subsystem rewrites in a memory-safe way prioritized by bugs found by bounty program (and other ways). If they're allergic to non-C languages, a safe C subset like SAFEcode or C0 could be used[1]. [1] I'm saying it's possible to have a memory safe C subset with current compiler technology, even though you can point out something missing from C0
- deleted 10y ago[deleted]
- pawadu 10y agoGoogle already pays bounty for a lot of FOSS projects. And if the bugs you find can be exploited in google products the bounty is _very_ high.
- sn 10y agoThis functionality appears to have been introduced in linux 2.6.33 with commit a2e272554 . Looking at http://vault.centos.org/6.8/updates/Source/SPackages/kernel-2.6.32-642.4.2.el6.src.rpm http://vault.centos.org/6.8/updates/Source/SPackages/kernel-... it looks like RedHat backported this function but has not applied the fix.
- kopy 10y agoI don't get it, if this was fixed in March, which systems are compromised by this? Do I need to worry about a fully upgraded ubuntu 14.04 with or without the Hardware Enablement Stack?
- fulafel 10y agoDue to the way Linux people handle security fixes, a lot of the time the code fix goes in at first, then people decide it's an exploitable vulnerability, and then they have an embargo period without public discussion so everyone[1] can release a security patch at the same time. So hopefully Ubuntu has a kernel update ready to be released and they will send it out just about now. Unfortunately in this case Ubuntu's CVE tracker just shows "needs-triage" or "does not exist" for CVE-2016-7117. [1] Well, most Linux systems don't get timely security patches, like most Android phones or most embedded/iot products, but you get the idea
- anarcat 10y agofor those wondering, Debian is mostly not vulnerable, except for the oldstable/LTS release: https://security-tracker.debian.org/tracker/CVE-2016-7117 https://security-tracker.debian.org/tracker/CVE-2016-7117
- solarized 10y agoJust wait until torvalds wrote a new language. Publish it and made it as a new standard. Again.
- bArray 10y agoProgrammers, hear me! It is true, what many of you have heard. The security experts have gathered an army and as I speak, that army is drawing nearer to our kernel. Believe me when I say we have a difficult time ahead of us. But if we are to be prepared for it, we must first shed our fear of it. I stand here, before you now, truthfully unafraid. Why? Because I believe something you do not? No, I stand here without fear because I remember. I remember that I am here not because of the path that lies before me but because of the path that lies behind me. I remember that for many years we have fought these security guys. I remember that for many years they have sent their armies to destroy us, and after a life-time of war I remember that which matters most... C is still here! Today, let us send a message to that army. Tonight, let us shake this thread. Tonight, let us tremble these keyboards of silicon, steel, and plastic, let us be heard from low-level assembly to bloat-ware web applications. Tonight, let us make them remember, THIS IS LINUX AND WE ARE NOT AFRAID!
- HerrMonnezza 10y agoIt seems that Linux distros are now releasing fixes: - Debian is prevalently not vulnerable: https://security-tracker.debian.org/tracker/CVE-2016-7117 https://security-tracker.debian.org/tracker/CVE-2016-7117 (except the "oldstable" release) - for Ubuntu, the situation is more complicated, as it depends on the actual kernel package installed: https://people.canonical.com/~ubuntu-security/cve/2016/CVE-2016-7117.html https://people.canonical.com/~ubuntu-security/cve/2016/CVE-2... For the "linux" kernel package (prob the most common), the situation looks like this at the moment:: Upstream: released (4.6~rc1) Ubuntu 12.04 LTS (Precise Pangolin): needed Ubuntu 14.04 LTS (Trusty Tahr): released (3.13.0-86.130) Ubuntu Touch 15.04: DNE Ubuntu Core 15.04: pending (3.19.0-59.65) Ubuntu 16.04 LTS (Xenial Xerus): released (4.4.0-22.39) Ubuntu 16.10 (Yakkety Yak): not-affected (4.4.0-22.39) - for CentOS/RHEL, my understanding is that fixed kernels have not yet been released: https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2016-7117 https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2016-7117