Slashdot Mirror


Linux Kernel Back-Door Hack Attempt Discovered

An anonymous reader writes "The BitKeeper to CVS gateway was apparently hacked in an attempt to add a root exploit back door to the Linux kernel, according to the linux-kernel archive. The change was in the file kernel/exit.c and changed the user ID of a process to root under the guise of checking the validity of some flags. The core Linux BitKeeper kernel repository was not at risk, and in fact it was the BitKeeper CVS export scripts that detected the unauthorized modifications to CVS. The changes were falsely attributed in CVS to long-time Linux developer davem (David Miller). Users of the BKCVS repository should resync their trees to remove the offending code if they had replicated it since yesterday."

11 of 687 comments (clear)

  1. Calm down, calm down... by nmoog · · Score: 5, Informative

    Keep reading the thread - you'll read a bid of Linus, and a comforting explaination of whats happenin' back there.

  2. Trusting Trust by ceswiedler · · Score: 5, Informative

    The Ultimate Backdoor, if anyone hasn't read about it:

    Reflections on Trusting Trust.

    You might want to doublecheck that gcc code you're compiling the kernel with...

  3. Re:Well well by temojen · · Score: 4, Informative
  4. As noone else seems to have pointed out yet... by temojen · · Score: 4, Informative

    The "backdoor" that someone attempted to submit was a local privilege elevation bug, not a remote compromise.

  5. Re:Well well by sartin · · Score: 5, Informative
    what is to say that they couldn't dupe everyone even with the source available to all?

    You mean like this?

  6. doubters are forgetting the foundations of OSS by RouterSlayer · · Score: 5, Informative

    I see some people posting some negative replies, or lamenting on OSS process, etc and saying how it didnt work, or how a psuedo-trusted patch would get in, if it went through proper channels, or some such crap.

    this couldn't be further from the truth, you are all forgetting many things, #1 - the checking scripts run daily now, and Larry has mentioned he's going to step that up, still fixed within 24hrs is a damn good response time! closed-source could never be this fast.

    #2 - all this talk of peer review, saying it didn't catch this or whatever nonsense, yes in a way it did, and whats more it's exactly what will keep semi-valid attempts or those through "proper channels" out of the code. You forget, millions of people around the world review this stuff, and someone, somewhere will find it relatively quickly, and not just because all the good developers (which is most of the millions) really LIKE linux and do their utmost to protect it, and ensure that no twits do things like this.

    on the oft-side billions to one chance someone does something stupid like people said hire someone to do good patches for a long time, get trusted, and submit a patch with this kind of code in it, well, first of all, this is just stupid, it would take years to get that trusted from "zero", second, even assuming all that, the code would still get caught very quickly.

    Like I said, someone, somewhere is gonna notice real quick, because the millions of us out in the world really happen to LIKE linux, and protect the kernel most of all, and I'm sure as the code worked its way into the tree, one of the people would catch it, and I'd be willing to bet several would see it at the same moment, including Linus, et all.

    You simply can't pull a fast one over the great coders we have, these aren't your average coders, and remember, not just them, but all of us, really, in a way, put our heart and soul into supporting Linux, its a confidence we dont share lightly, the kernel is the most protected of it all, yes, for obvious reasons, its the most critical code.

    But even outside the kernel, remember millions of people around the world are reviewing code 24hrs a day, every day, and posting notes about issues, patches, etc.

    It's simply much harder to get by all that. Like I said, and I'll say it again, someone's gonna notice, and probably LONG before it even gets into the main BK tree, because even those reviewers ain't slouches!

    Closed source has a smaller review team, and I know for a fact internal developers add back-doors to code all the time. I know many closed-source coders (not necessarily personally) that as a matter of habit throw in back-doors into every piece of code they write, because they hate their job, and the people they work for, and hate the product. Since very few people ever review the code, things can sit there indefinately and never get found.

    remember this is a work of pride, something the community really cares about, we really want to see it succeed, and not have the issues like this, or that others have, we want to protect it at all costs, in any way, to ensure a good future, and protect the users out there.

    remember, we're users too! If it means that much to you, wouldn't you be checking it too? damn straight! This is exactly why the OSS model is so damn important,

    and its exactly why Microcrap, SCO, etc will never "get" it. I'd even add Intel to this list, because I think AMD is really "getting" it.

    summary - we like it, we care about it, and aint no way we gonna let some dork attempt to ruin something we've worked so damn hard to build, not just for ourselves, but for everyone, its a matter of pride.

    and yes, anyone found out (and they will be!) doing this shit is gonna get their ass kicked into next week...

  7. Re:Well well by temojen · · Score: 5, Informative

    All of the vulnerabilities I listed made it into official releases before being patched. The bug this story is about didn't make it one day in the source tree, let alone into an official release.

    Sorry about the Protegrity one, I must've linked the wrong one. I was looking for this one (the one exploited by the slammer worm).

  8. Re:Daaaammmmmnnnn.. by shepd · · Score: 3, Informative

    >What's the penalty under the law for putting a backdoor in an open-sourced software project?

    Ohhh, I can think of some.

    Fraud and destruction/misuse of private property come to mind. And those are pretty much universal...

    --
    If you could be told what you can see or read, then it follows that you could be told what to say or think - BoC
  9. Re:Microsoft by Tailhook · · Score: 4, Informative

    The actual lines of code and the method by which they got there were far too clever for either Microsoft or SCO

    It was a subtle change but I think it would have been caught if it had been submitted to Linus. He does review code and often catches mistakes. In this case assignment was used in a condition. To good C programmers this is bad taste. I noticed that right off and I haven't written a line of C in about 6 years. Linus isn't just a good C programmer. After half a decade of watching him catch stuff like this in just his public LKML messages, I'm convinced he would have seen this if he were reading braille hardcopy of it from across the room while drunk.

    --
    Maw! Fire up the karma burner!
  10. I wonder why not a remote root hack by Krellan · · Score: 5, Informative

    The vandal who put this in the CVS code tree obviously had a lot of skill.

    It's a clever backdoor, and might have gone unnoticed, if not for those those good automated checks in the BitKeeper-to-CVS gateway. Notice that the particular coding style is a common C gotcha (using "=", assignment, instead of "==", comparison). At first glance it looks like the value of uid is being compared with 0, when in actuality it is being assigned the value of 0: root! The gcc compiler is good about warning for this, except that this too has been defeated: as mentioned on the mailing list, notice the unusual high number of parenthesis around this expression. That high number of parenthesis has the effect of suppressing the gcc compiler warning.

    So, whoever did this obviously knew what they were doing and tried to obfuscate it. As somebody else mentioned on the kernel mailing list, if somebody is going to put in a backdoor like this, why not make it a remote root hack?

    As it is now, the above hack is only locally exploitable. A process on the local system still has to call the wait system call with that particular combination of flags, in order to trigger the exploit and get root. To my knowledge, no known applications do this, because the combination of flags is supposed to be invalid.

    If a spammer or somebody else was trying to backdoor the Linux kernel in order to gain a large number of machines to infest, then one wonders why they didn't put in a remote root exploit. It seems strange to go to all the trouble. Since this backdoor attempt has been caught and blocked, security will now only become tighter, and they might not ever get another chance like this.

    Maybe it was intended to be used with another application, also backdoored in the same manner? It might be insightful to scan other open source applications and search for this particular usage of flags to the wait system call.

    In any case, I'm glad this hack was caught!

    1. Re:I wonder why not a remote root hack by You're+All+Wrong · · Score: 3, Informative

      Nonsense, you're talkin out of your arse.

      The brackets are necessary to even get the thing to compile as the precedence of '=' is below that of the logical operators.

      bash-2.05a$ cat > test.c
      int foo() {
      extern int x,y,z;
      if(x>y && z=0) x=y;
      }
      bash-2.05a$ gcc test.c
      test.c: In function `foo':
      test.c:3: invalid lvalue in assignment

      YAW.

      --
      Your head of state is a corrupt weasel, I hope you're happy.