These forums are read-only!
Kernel Vulnerability - Are We Safe?
  • Link: http://www.securityfocus.com/bid/27704/info

    Seems 2.6.16 and above are vulnerable, with 2.6.24.1 being safe. Are our slices affected? I've not had the chance to compile and run the exploit code on my server yet, so I'm kinda posting this blind...

    Exploit example: http://downloads.securityfocus.com/vulnerabilities/exploits/27704.c
  • Neither exploit appears to work on either of the active kernels we are using. I don't believe that the versions listed as vulnerable are accurate. The patched code affects a function that was implemented in the 2.6.23 tree and according to the discussion thread on the kernel mailing list 2.6.22 and older kernels are not affected.
  • I just tried it on my slice and the exploit does not work.
  • i read that it was 2.6.17 to current. Since slicehost uses 2.6.16, I believe it is safe (not certain though).

  • Linux version numbers are a bit suspect because there are so many vendor kernels around. You never know what features they will backport. For example, NPTL was added in 2.6.x but I've run RedHat 2.4.x kernels that supported it.

    However, on my slice (which claims to be 2.6.16.29-xen), vmsplice() returns -1 with errno set to ENOSYS, so it definitely does not have the affected syscall. Not vulnerable.
  • Just ran it on my slice, CentOS 5.1, 2.6.16.29-xen. Doesn't work, vmsplice returns ENOSYS, as slamb said. Interestingly enough it didn't compile, seems there's a bug in CentOS' kernel headers package because asm-x86_64/page.h was empty, had to copy in definitions from asm-i386/page.h manually
  • The exploits doing the rounds are written with x86 specific code. My slice, at least, is amd64, so the thing being circulated will not work. That alone doesn't mean you aren't vulnerable.

    My slice is a debian one with uname 2.6.18-xen. A vanilla 2.6.18 IS vulnerable- compare http://lxr.linux.no/linux+v2.6.18/fs/splice.c#L1141 against the patch that was committed to fix this - http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=712a30e63c8066ed84385b12edbfb804f49cbc44
  • Jon,

    2.6.18 is vulnerable to CVE-2008-0600 it appears and not CVE-2008-0009/10. The official xen 2.6.18 branch had the patch incorporated yesterday and our 2.6.18 kernels are updated.

    http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/08e85e79c65d
  • I am new to VPS hosting. Just wondering we just need to reboot our slice to get it to start using the patched kernel correct?
  • You will need to restart to reload your kernel.

    This is what you want to see

    # cat /proc/version
    Linux version 2.6.18-xen (root@sh-kern) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) #1 SMP Tue Feb 12 06:40:50 UTC 2008


    This is also ok-

    # cat /proc/version
    Linux version 2.6.16.29-xen (root@jason) (gcc version 3.4.6 (Ubuntu 3.4.6-1ubuntu2)) #1 SMP Sun Sep 30 04:00:13 UTC 2007
  • Hi jason,

    Just to be clear. If I see this:

    # cat /proc/version
    Linux version 2.6.16.29-xen (root@jason) (gcc version 3.4.6 (Ubuntu 3.4.6-1ubuntu2)) #1 SMP Sun Sep 30 04:00:13 UTC 2007

    Do I still need to restart my slice?

    thx.
  • Thanks Jason. First time i had to reboot my slice since i set it up. Funny had forgotten to add apache and mysql to my default run levels since i installed them all. Thanks again.
  • Llama,

    No that version is fine.
  • Is this OK?

    $ cat /proc/version
    Linux version 2.6.18-xen (root@jason2) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) #1 SMP Fri Nov 2 06:14:54 UTC 2007
  • bhoggard, no that is not one of the two listed in my prior post, if you reboot you should see a different version.
  • I've rebooted twice, both hard and soft, but I still get this:
    cat /proc/version
    Linux version 2.6.18-xen (root@sh-kern) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) #1 SMP Tue Feb 12 06:40:50 UTC 2008

    I also tried to update & upgrade, but it's still the same.
  • aQ, that is the updated version.
  • So, I have this:

    Linux www1 2.6.16.29-xen #1 SMP Sun Sep 30 04:00:13 UTC 2007 x86_64 x86_64 x86_64 GNU/Linux

    No change after reboot. Am I OK?
  • Aha, thanks, Jason... I'm sorry.
  • Just noting that these are "local" exploits which rely on someone in userland having access to the compilers. My users don't get to see such things! Besides, all the example code stopped cold on exec with segmentation faults, well before privilege escalation was attained. But still, one never knows. My Ubuntu Slice (2.6.18) has been given a swift reboot in the butt and all is well once again in Sliceland! Thanks for your diligence, Jason!
  • For what is worth, if you have the 2.6.18, after restart your slice, you should see the date updated to Feb 12, which is the patched kernel. The version remains the same:

    Before:

    visualize -: uname -a
    Linux visualize 2.6.18-xen #1 SMP *Fri Nov 2 06:14:54 UTC 2007* x86_64 GNU/Linux


    After (patched):

    visualize ~: uname -a
    Linux visualize 2.6.18-xen #1 SMP *Tue Feb 12 06:40:50 UTC 2008* x86_64 GNU/Linux
  • Posted By: Gadget


    Just noting that these are "local" exploits which rely on someone in userland having access to the compilers. My users don't get to see such things!



    This is not the case, you don't need to compile an exploit on the host it is going to run on, you could copy a compiled binary from elsewhere. Having no compilers accessible is not protection.

    (side-note about the forums: the "quote" button on the threads doesn't work if the message you you are quoting is not on the last page of the discussion)
  • Posted By: jon(side-note about the forums: the "quote" button on the threads doesn't work if the message you you are quoting is not on the last page of the discussion)


    That's annoying, wanted to quote this, had to do it manually:

    Posted By: artageswSo, I have this:

    Linux www1 2.6.16.29-xen #1 SMP Sun Sep 30 04:00:13 UTC 2007 x86_64 x86_64 x86_64 GNU/Linux

    No change after reboot. Am I OK?


    Yes, you're OK. You didn't need to reboot anyway, as was said previously - only 2.6.18 kernels are affected.
  • @Jon

    Sigh... You're absolutely right of course. I'm lucky in the sense that I don't need to give my users any form of access to the shell, or to any means of non-vetted upload (uploads via CMS are restricted and require administrator approval - binary ELFs and shell scripts are automatically detected and red-tagged), but, really, you're very right. I should never say never. But, in my case, if a user manages to get an ELF into the system, I've got much bigger problems. Still, if anyone touches ROOT shell (even via this exploit), I see it in seconds on my cellphone, and BAM, there goes the Slice. Still, you're right. You can bet that I sleep just a little bit better knowing that my Slices are patched now. The Slicehost guys do rock. I mean, how many VPS providers out there are still running unpatched versions of Apache 1.3 and PHP4, with plaintext access to control panels and such, never mind the kernel? Did I say that you're still absolutely right, Jon? :-)
  • Gadget, do you really think that you need a "non-vetted upload" to cause execution of arbitrary code? Have you ever used a root shell exploit that actually ran your silly .bashrc trick? You're really not doing anyone a favor by spreading security fallacies. Hit the books, my friend!
  • I'm afraid there are more ways to execute arbitrary code than one can count. I also have declared right from the start that my silly .bashrc trick is exactly that: one line of code to merely help you a little, not take over your duties as a competent sysadmin. I have also said that it is a one-trick pony, and as you are aware, it takes many tricks to come even close to a basic level of security. The particular C code presented did in fact invoke the shell in such a way that .bashrc was called, at least on my quarantine machine. As for security on my personal Slice, which is really just a site for my hobby business, it's adequate for the job. My data is secure (read - downloaded every evening to my own machines), and everything else is merely fun. When the fun stops, the Slice gets repaved without any hesitation on my part. Here in the forum, I really just have a light-hearted intent to provoke discussion and thought, which is the first step to awareness of the issues. I would be very pleased if you shared some of your ideas with us too.

    8-)

    I have hit many books and have been hit with more than a few too. No matter, I absorb something everytime, so please, feel free to hit me with one!
  • Currently, I am running a 256 slice with Ubuntu 7.10 with 2.6.18-xen.

    I know you will think I am silly here, but I deleted the other modules directories /lib/modules/, other than the 2.6.18-xen to save disk space. As of now, is my slice in danger of not working if I reboot it?

    If so, do you have a tar archive of the modules directory for kernel 2.6.16.29-xen?

    Or otherwise, can I select which kernel to boot from?

    Thanks,
    Jeremy
  • Deleting them shouldn't be a problem. If you do have an issue open a support ticket and we can help you replace them.
  • Thank you Jason. I have other questions:

    p. In my current state, if I reboot my slice, will it fail?

    @$ ls -al /lib/modules/
    total 12
    drwxr-xr-x 3 root root 4096 2008-01-25 23:52 .
    drwxr-xr-x 13 root root 4096 2008-03-06 22:56 ..
    drwxr-xr-x 3 root root 4096 2007-12-05 22:56 2.6.18-xen@

    p. How do I know which kernel my slice will be booted with the next time it re-starts?

    p. Can I select which kernel to boot from?

    Jeremy
  • I am sure it will boot just fine. I run Debian an I am also using the 2.6.18-xen kernel. This is as far as I know, the default kerner the system boot with at every boot. And if you encounter a problem, just open a support ticket.

    Birger :)