Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×

Weakness In Linux Kernel's Binary Format 281

Goodfellas writes, "This document aims to demonstrate a design weakness found in the handling of simply linked lists used to register binary formats handled by the Linux kernel. It affects all the kernel families (2.0/2.2/2.4/2.6), allowing the insertion of infection modules in kernel space that can be used by malicious users to create infection tools, for example rootkits. Proof of concept, details, and proposed solution (in PDF form): English, Spanish.
This discussion has been archived. No new comments can be posted.

Weakness In Linux Kernel's Binary Format

Comments Filter:
  • And? (Score:5, Informative)

    by ledow ( 319597 ) * on Tuesday October 03, 2006 @06:54PM (#16298943) Homepage
    Although any auditing is welcome and they may be a problem here, the fact is that it's hardly news and not exploitable. The reports says itself that you have to be root to exploit it. It's already game-over. Yes, look for these sorts of things and find them but it's hardly worth the shock-factor of "Massive Hole Found In Linux" panic headlines.
  • by Spikeles ( 972972 ) * on Tuesday October 03, 2006 @06:57PM (#16299001)
    For those who won't read it..

    Basically there is this table that contains a list of handlers for the various exes, if if a handler returns a failure the loop that parses the table will stop iterating. If you insert a kernel module first you can take control of all executable types b4 any other handles get to handle it.

    BUT...It requires root access and wont work on SELinux. This is a serious how? I mean if you have root access, then the entire system is compromised already.
  • Re:And? (Score:2, Informative)

    by Anonymous Coward on Tuesday October 03, 2006 @07:09PM (#16299119)
    How many average-Joe-who's-friends convinced-him-to-run-Linux's run as root, though?
  • Probably none. (Score:5, Informative)

    by SanityInAnarchy ( 655584 ) <ninja@slaphack.com> on Tuesday October 03, 2006 @07:15PM (#16299189) Journal
    Depends on the friends and the distro, but let's see. Debian prompts you to set up an ordinary user/password, as well as a root password. Gentoo does the same, only via documentation, not an installer. And Ubuntu, the distro most friends would send noob-friends to, does not set up a root password at all -- all root access on Ubuntu has to go through sudo.

    Most Windows/IE attacks don't require you to even have local access, let alone root.
  • Mirror (Score:5, Informative)

    by paulproteus ( 112149 ) <slashdot AT asheesh DOT org> on Tuesday October 03, 2006 @07:20PM (#16299235) Homepage
    I've mirrored the English PDF [jhu.edu].
  • Re:Criptic summary (Score:1, Informative)

    by Anonymous Coward on Tuesday October 03, 2006 @07:20PM (#16299237)
    Apparently (according to another poster) it is. So who enables misc binaries in a kernel build and why would they do this? The only people I can think off are mono users but they're fools anyway.
  • by IWannaBeAnAC ( 653701 ) on Tuesday October 03, 2006 @07:21PM (#16299243)
    With the caveat that I cannot RTFA as it is slashdotted, if the summary is in any way accurate then it will not affect the BSD's or Solaris. SCO I don't care about, especially as it would only affect them if they stole the relevant code from Linux in the first place.

    Linux has a feature that allows you to register a new binary format loader. Of the traditional formats, ELF is the most common, a.out is ancient, I don't think I've ever seen an a.out executable on a Linux machine). But on Linux, for example, if you wanted java programs to run automatically when you execute them then you could install a loader for java files that runs them through the interpreter/jvm.

    I don't know which other unixes have this capability, but IIRC Linux was the first so it follows that any other implementation is architecturally independent, so shouldn't share the same implementation flaws.

  • Re:Probably none. (Score:2, Informative)

    by oKtosiTe ( 793555 ) on Tuesday October 03, 2006 @07:27PM (#16299301)
    No, only the initial user account does.
  • by Tyger ( 126248 ) on Tuesday October 03, 2006 @08:01PM (#16299587)
    I'd say this is just a specific case of inserting malicious code into a kernel level linked list. Most kernels have linked lists meant to be accessed by drivers. I've actually done something very similar in Solaris using the SVR4 STREAMS driver model. I created a STREAMS module that inserted itself into the TCP stack in such a way that it was totally invisible, but got all data and control commands passed through it. (Excpet I wasn't writing malicious code. In that case, I was hiding it from any potential hackers, as well as applications that might break if the STREAMS modules aren't loaded like they expect.) There are other places it could be inserted for malicious purposes aside from the network stack, though. (Not that the network stack isn't a bad place to be for someone who wants to do some damage, but it doesn't help with hiding rootkits. It would be more useful as a rootkit payload.)

    I'm sure BSD has a linked list that could be similarly exploited. It won't have the same capabilities as the Linux binfmt one, but it will have it's own set of things it could be used for.

    However, I agree with other users. In a monolithic kernel, once someone has root and can load kernel drivers, or even access kernel memory, all bets are off. The only possible system I can see not being exploitable in such a way would be a pure microkernel architecture with memory protection, none of which I can think of off the top of my head. Mach still has loadable modules. QNX is closer but even QNX lets you register code to be called as an ISR from the kernel, and at that point you have full access to the kernel memory, and you are even conveniently passed a pointed to some kernel data structures so you don't have to try and figure out kernel symbols.

    The point is, once you have root, there are any number of ways to compromise the system and hide your exploits. It's good to have the information about as many different ways as possible out in the open, but it's hardly alarming news that there's yet another discovered.
  • FYI, I believe it is the kernel itself that interprets the #!(interpreter)\n at the start of a file, not the shell.

    But anyway... I don't think you can constrain root with chroot(2) anyway. root can mknod(2) himself a device file and access your filesystems directly if he wants. Or he can do the same for one of the mem(4) devices. Or call ioperm(2) and talk to hardware devices with iopl(2). There are probably dozens of other methods to escape from such a 'jail'.
  • by Lehk228 ( 705449 ) on Tuesday October 03, 2006 @08:10PM (#16299667) Journal
    that is more due to limitations on NTFS and FAT* than self protection

    unix filesystems can delete an in-use file and only physically remove it when it is no longer in use, windows cannot do that. hence having to reboot for so many updates and some configuration changes (such as changing host name)
  • Re:simply (Score:5, Informative)

    by Penguinoflight ( 517245 ) on Tuesday October 03, 2006 @08:13PM (#16299695) Journal
    Most CS types would say that SLL is Singly Linked List. The construct allows for references to next, but not to previous.
  • Re:Probably none. (Score:3, Informative)

    by bcat24 ( 914105 ) on Tuesday October 03, 2006 @08:23PM (#16299793) Homepage Journal
    Werd. That's why the first thing I do when I set up a Ubuntu box is enable the root account and make sudo use the root password, not the user's password.
  • Re:Probably none. (Score:3, Informative)

    by SanityInAnarchy ( 655584 ) <ninja@slaphack.com> on Tuesday October 03, 2006 @08:27PM (#16299827) Journal
    It used to be risky. Password hashes used to actually be stored in /etc/passwd, where anyone could read your password hash. If there was a weakness in the hash algorithm, or your password was particularly short, they could brute-force it that way -- hence, "time consuming".

    On most modern systems, it is also impossible, because the actual password hashes have been moved to /etc/shadow.

    If you are root, you can still attempt to brute-force them -- which would be time-consuming and almost never has a point. If you're hoping they use the same password elsewhere, you can simply install a keylogger -- which is assuming you weren't smart enough to do that when they first set their password. If you simply need access to their account, you can su in. If you need to reset their password, you can do that as root without knowing the original password.

    Which means that this whole system is about as exploitable as an "exploit" which gives you root access, but which only works if you're already root.
  • by mr_tenor ( 310787 ) on Tuesday October 03, 2006 @10:38PM (#16300585)
    Why bother just tinkering with kernel modules when you can just replace the whole kit-n-kaboodle?


    Because it's damn hard! Nobody here seems to realise that the point of this paper is (I'm guessing) that there's yet another neat way to code up an exploit "without depending on the sys_call_table[]" - it's in the damn title.

    If you know anything about the topic, which I guess most people who've commented don't, then it's near trivial for an attacker to write code to do unauthorised stuff if they have the address of the symbol sys_call_table, but that's been removed to make life harded for shellcoders.

    And "having root" doesn't mean an attacker sits down at an xterm with a root account, it might mean that he can remotely trick some system service into running 24 bytes of instructions as root or something. So stop being so dismissive of this sort of research.
  • by Dogun ( 7502 ) on Wednesday October 04, 2006 @12:27AM (#16301251) Homepage
    Really? '*'? You're quite sure about that?
  • Re:Probably none. (Score:5, Informative)

    by smash ( 1351 ) on Wednesday October 04, 2006 @01:55AM (#16301667) Homepage Journal
    Knowing about how linux works doesn't exclude you from the set of potential ubuntu users.

    I've adminned Linux since 1996 (1996-2001 as an ISP sysadmin, 2001-2004 for corporate mail, proxy, IPSec gateway, etc), yet most of the time these days for a desktop I install/use/recommend Kubuntu. Why? Because it just works for the most part. I've been through the rolling my own distro from scratch, building all my stuff from source games and to be honest, I have more important things to do these days :)

    Sure I'll muck around with that sort of thing from time to time, but when I just want to get work done, *ubuntu is quick and easy.

  • Re:Probably none. (Score:3, Informative)

    by SanityInAnarchy ( 655584 ) <ninja@slaphack.com> on Wednesday October 04, 2006 @02:24AM (#16301809) Journal
    This has got to be the most obnoxious thing people do on Slashdot. Yes, I got the joke. It was funny, I laughed. My comment is also actually relevant to the discussion.
  • by Anonymous Coward on Wednesday October 04, 2006 @02:49AM (#16301937)
    If you get to the point where you can load code into the kernel (as in; load a module), then you can replace *anything* in the kernel and you effectively own the box.
    There's no bug here.
  • by julesh ( 229690 ) on Wednesday October 04, 2006 @04:18AM (#16302319)
    It seems to me that having root access != having easy backdoor access to exes.

    For instance, if I can load a wrapper around your financial program, without modifying your financial program (So AIDE would find it), I could more easily grab your data.


    Yes, but there are already so many ways that modification could be made:

    * Modify libc.so to perform the task you want (applicable to all modern unix systems)
    * Modify ld-linux.so or equivalent to perform the task you want (applicable to all ELF-based systems)
    * Modify the system config to automatically load an additional shared library to perform the task you want
    * Modify the user's config to automatically load an additional shared library to perform the task you want
    * Add a module to the kernel that intercepts the system calls the program wants and performs the task you want
    * Add a module to the kernel that allows an additional process to snoop on the program's memory and perform the task you want
    etc.

    There are plenty of ways of using the operating system's features to do just about anything you want to, even to other programs. This is intentional. It allows flexibility. There is a reason why new binfmt handlers are added to the front of the list, rather than the back, and that is to allow a new handler to override specific cases that would usually be handled by an old one. You add generic handlers first (typically just the ELF loader these days) and then specific ones afterwards (perhaps a handler for broken ELF files produced by a strange compiler). You don't want to have to load the specific ones first, because specific stuff is less likely to be actually needed, so you really want it to be a module.
  • by Tony Hoyle ( 11698 ) <tmh@nodomain.org> on Wednesday October 04, 2006 @04:24AM (#16302343) Homepage
    Create token is the 'meta' privilege - it lets you create a system level token with *any* privilege and then switch to that context... essentially anyone/thing with that privilige has all rights to the system and you cannot stop them (takes a little work.. it's not got a GUI or anything, but anyone with access to MSDN online could work it out).

    The NT system is ass backwards because it lets you *add* privileges. The Linux capabilities system does it right - process 1 starts with all privileges, then it removes them. It is *impossible* to add a new privilege - you have to ask a more privileged process to do your work for you.

  • by Tony Hoyle ( 11698 ) <tmh@nodomain.org> on Wednesday October 04, 2006 @04:37AM (#16302399) Homepage
    You misunderstand what FILE_SHARE_DELETE does.

    That just allows other processes to open a file that is opened with delete access. It does not allow you to delete a file that is in use - that is still impossible in Windows.

  • Re:How come... (Score:3, Informative)

    by BertieBaggio ( 944287 ) * <bob@@@manics...eu> on Wednesday October 04, 2006 @06:42AM (#16302839) Homepage

    Because people don't know the correct tags. It should be:

    > fud, !fud

    Quoth the FAQ [slashdot.org]:

    For the opposite of a tag, prefix it with "!", e.g. "!funny" means unfunny.
  • Re:Criptic summary (Score:1, Informative)

    by Anonymous Coward on Wednesday October 04, 2006 @05:10PM (#16311857)
    Hint: that is not an a.out file.

Scientists will study your brain to learn more about your distant cousin, Man.

Working...