Slashdot Mirror


Linux Kernel 2.6 Local Root Exploit

aquatix writes "This local root exploit (Debian, Ubuntu) seems to work everywhere I try it, as long as it's a Linux kernel version 2.6.17 to 2.6.24.1. If you don't trust your users (which you shouldn't), better compile a new kernel without vmsplice." Here is millw0rm's proof-of-concept code.

20 of 586 comments (clear)

  1. Re:Misleading by shadow42 · · Score: 5, Informative

    I just successfully used this exploit on a Fedora 7 box running 2.6.22.4. A bit out of date, yes, but a great deal of "home users" who are running Fedora, Debian, Ubuntu (especially Ubuntu), etc., either don't know how to compile their own kernel, or don't care enough to try. Not everyone who uses Linux is going to bother compiling a custom kernel in order to fix a problem like this, especially if they don't have the skills of a sysadmin.

  2. Re:For those that would rather write than read. by McDutchie · · Score: 5, Informative

    Nope, all you need is remote access to a local user account via ssh or something. Many users use weak passwords. Now you won't have to guess the root password.

    Yes, I just verified the exploit on Linux 2.6.17.13 (Slackware 11.0) and Linux 2.6.21.5 (Slackware 12.0) and it works as advertised.

  3. Funny comments :) by K.+S.+Kyosuke · · Score: 5, Informative

    There are some pretty funny comments in the source code, regrettably, most people won't understand them. Hell, as a Czech, I *am* probably supposed to understand them, if it were not for the obscure north-eastern dialect of Czech that all the rest of our country finds hilarious (and incomprehensible at the same time).

    "Dovalim z knajpy a cumim ze Wojta zas nema co robit, kura." == something like "Just returned from the pub and saw that Wojta [a machine? Or a person? Unclear...] has nothing to do." [The last word might be a Czech expletive with a typo...?]
    "Gizdi, tutaj mate cosyk na hrani, kym aj totok vykeca." == something like "Here's something for you to play with, boys, ..." [last for four words utterly incomprehensible :)]
    "Stejnak je to stare jak cyp a aj jakesyk rozbite." == "Anyway, it's old as hell and somehow broken anyway"

    The style (no way am I able to render *this* in English :)) makes me think that had drunk quite a bit before he wrote these gems. Pity that I don't have a good dictionary of spicy English. I'm just rolling on the floor and seriously laughing. :) Oh, and the exploit works, which is not that *funny*.

    --
    Ezekiel 23:20
  4. Re:Beauty of OSS by fuzzix · · Score: 4, Informative

    On the other hand though this is the beauty of open source. The problem is now known so I'm sure a fix is already on the way.

    Or already here...
    This appeared to work...
  5. This workaround works by FliesLikeABrick · · Score: 4, Informative

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=464953

    The workaround posted in a follow-up in that thread works. I had a few vulnerable (tested) machines that I cannot reboot even if a patched kernel is released in the near future. I tried that fix, then tried the exploit again. The exploit no longer worked after using the fix (workaround).

    Those machines were debian x64.

    Ubuntu kernels do not appear to have vmsplice enabled by default.

    1. Re:This workaround works by arabagast · · Score: 3, Informative

      Ubuntu 7.10, latest generic kernel image (standard image) is affected

      Linux kenshu 2.6.22-14-generic #1 SMP Fri Feb 1 04:59:50 UTC 2008 i686 GNU/Linux

      --
      Doolittle : ...What is your one purpose in life?
      Bomb no.20 : To explode of course.
  6. Re:Beauty of OSS by Anonymous Coward · · Score: 5, Informative

    The problem is now known so I'm sure a fix is already on the way. Holy shit, no kidding - the form of an exploit which fixes the bug live in the kernel mem.
    nobody$ ./exploit
    [..]
    [+] mmap: 0xb7f29000 .. 0xb7f5b000
    [+] root
    root# ^D

    nobody$ ./disable-vmsplice-if-exploitable
    [..]
    Exploit gone!
    nobody$ ./exploit
    [+] mmap: 0xb7f34000 .. 0xb7f66000
    [-] vmsplice
    nobody$ no root for me anymore!


    By Morten Hustveit:
    "a modification of the exploit that finds the address of sys_vmsplice in the
    kernel (using /proc/kallsyms) and replaces the first byte with a RET instruction
    (using mmap of /dev/kmem)" from
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=464953#14

  7. Re:I am so depressed ... by Cytlid · · Score: 4, Informative

    Uh oh. There's another link, (not the one from the /. article) that worked on my machine:

    http://www.milw0rm.com/exploits/5093

    Notice the original article links to 5092.

    --
    FLR
  8. This flaw is CVE-2008-0600 by iamamoose · · Score: 5, Informative

    Upstream patch for the vulnerability tickled by that specific exploit is here
    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=712a30e63c8066ed84385b12edbfb804f49cbc44

    Red Hat tracking bug (Enterprise Linux 5 is affected, but 4,3, and 2.1 are not)
    https://bugzilla.redhat.com/show_bug.cgi?id=432251

    Fedora tracking bug
    https://bugzilla.redhat.com/show_bug.cgi?id=432229

  9. SELinux? by Rob+Riggs · · Score: 3, Informative

    Well, I can tell you that SELinux (enforcing, targeted) on Fedora 8 was no help in preventing this exploit. Does "strict" make a difference?

    --
    the growth in cynicism and rebellion has not been without cause
  10. Re:HA HA by TheVelvetFlamebait · · Score: 3, Informative

    No it doesn't.

    --
    You know, there is a difference between trolling and pointing out the flaws in your reasoning. Just saying.
  11. Re:I am so depressed ... by Cytlid · · Score: 3, Informative

    I did a "grep -i" on the term "splice" in my /usr/src/linux/.config and it came up empty.

      I did not include KVM support in my kernel on purpose.

      As this http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=9;filename=patch;att=1;bug=464953 patch points out, it's in the general fs splice.c code, so I think it is more serious than I originally had thought.

      For some reason, (if someone can substantiate this I would appreciate it) I could get neither code to work on a CentOS 4.6 machine setup as a server).

      I'm buying into the idea that it may be based (a little) on kernel config options, but an official patch would be bet

    --
    FLR
  12. Ubuntu 7.10 generic kernel is affected. by ikarous · · Score: 5, Informative

    The poster who said that Ubuntu kernels are not affected was incorrect, at least partially. The exploit code works as advertised on my Ubuntu machines, both of which are running 7.10 with the latest generic kernel image.

  13. Re:I am so depressed ... by nuclear_zealot · · Score: 3, Informative
    I got the same thing, so I edited the one line: (brackets edited out)

    #include asm/page.h to read:

    #include /usr/lib/klibc/include/asm/page.h and *poof* the exploit compiles and works on my 2.6.24 x86_64 box. Don't feel safe yet. :)

    BTW: Has anyone figured out if there is an option you can disable in make menuconfig that removes vmsplice(), or is it integral to the kernel?
  14. This is incorrect by bconway · · Score: 5, Informative

    Vmsplice is part of the core kernel, it is not a configuration option. It is used all over the place.

    --
    Interested in open source engine management for your Subaru?
    1. Re:This is incorrect by Vertigo+Acid · · Score: 3, Informative

      RTFS?
      2.6.14.7 does not fall within the affected range of 2.6.17 to 2.6.24.1

      --
      Beta is bad enough to make me go edit settings like this sig that haven't been touched since I joined
  15. Re:Misleading by caluml · · Score: 4, Informative

    Care to say, *which option* should we disable in the kernel .config ? Good question. I, from what I can see, don't think it has an option that you can disable. I just edited /usr/src/linux/fs/splice.c, and changed the line (round about line 1200-ish - differs slightly) from

    if (unlikely(!base))
    to

    if (!access_ok(VERIFY_READ, base, len))
    as mentioned in http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=712a30e63c8066ed84385b12edbfb804f49cbc44
    Then make and install the new kernel, reboot, and try the exploit. It should fail.
  16. Re:Beauty of OSS by Dan+Farina · · Score: 4, Informative

    > The security linux enjoys is because it is 1% market share, so bad guys don't care about it.

    This is probably true when it comes to malware targeting grandma, (note: you don't need a root exploit to do plenty of bad things, like install a keylogger on a user's session; IMO things like browsers should one day be relegated to another user as well) but you don't you think that people would be interested in breaking sendmail or BIND and the overwhelmingly UNIX (and increasingly GNU/Linux) systems that they run on? (They have in the past, many times in fact...)

    I think this position understates the incentives to attack Linux, because, quite frankly, virtually everything actually important infrastructure-wise runs on a UNIX-alike nowadays (VMS holdouts withstanding), and now it seems clear that with the possible exception of Solaris that all UNIX-alikes except Linux are in their death throes.

    > There are flaws in both open source and closed code, but I would say that closed code is better for security.

    I disagree. With closed source there is substantially less research and review that goes on. Important security bugs that are thought to not be "in the wild" can be swept under the rug indefinitely because they don't jive with business goals of the owning company. In the case of open source development any agent with an axe to grind (and oftentimes clients to reassure) can make it their priority to get the damn thing fixed.

    I think an axiom people have when they hold security-by-obscurity as a credible advantage is a defeatist regarding the nature of bugs: one *can* write a nearly-correct code; see qmail, TeX, dovecot, djbdns, and OpenSSL. It just takes time, effort, and sound engineering (which may include the limitation of scope, something that is hard to do in product-oriented firms). Linux 2.4 may be reaching this point; that's probably why NASA is considering deploying it on things that are actually important.

  17. The patch. Everybody needs this. by Daniel+Phillips · · Score: 4, Informative
    --
    Have you got your LWN subscription yet?
  18. Re:Beauty of OSS by Isauq · · Score: 4, Informative

    Funny you should mention that. This bug was fixed in a commit yesterday afternoon (http://lkml.org/lkml/2008/2/10/8).

    --
    RTFM