Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Amit Singh's Challenge: Find a Decade-Old Bug

Posted by timothy on Wed Apr 13, 2005 02:56 PM
from the older-than-the-os-that-hosts-it dept.
dreicodan writes "Well this has too many juicy Mac OS X nuggets in one bag! All details are on this page, but I'll summarise. Apparently Amit Singh discovered a 10+ year old serious bug in OS X. The bug started in Nextstep and is still in Panther (and apparently Tiger, too). Then Amit wrote a program to demo the bug, but also made the program capable of hiding what it does using some complicated Mach kernel voodo! He then threw a challenge open to OS X experts to figure out the bug. It turns out that a week and some 1000 downloads later, three brilliant hackers (Alexy Proskuryakov, Andrew Wellington, Graham Dennis) were able to solve the puzzle. Also looks like other than these guys, nobody got anywhere with the problem. Be ready for extremely gory details of how the program was written and how it was decoded. Its a thrilling read, and OS X hacking doesn't get any more hardcore than this! Hopefully Apple fixes this bug now at last."
This discussion has been archived. No new comments can be posted.
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • Funny responses (Score:5, Funny)

    by aftk2 (556992) on Wednesday April 13 2005, @03:00PM (#12226726)
    (http://www.electricstate.com/ | Last Journal: Friday May 05 2006, @03:08PM)
    While the actual solutions submitted to Singh's challenge were interesting, some of the other responses are more entertaining:
    "I think you must be hacking the main frame to crash the kernal. Whatever you're program is doing, its hot stuff!"


    "While I haven't looked at your program, but have you checked permissions? I had my system crash at random times due to messed up permissions on my external drive."

    "Could you at least of provided a simple Cocoa GUI for your program? Terminal app programs are not very popular with Mac people, you know."

    "Who do you think you are for insulting people like this?"
    That's some funny stuff.

    http://www.kernelthread.com/mac/challenge/result/ [kernelthread.com]
  • 10 years? (Score:4, Funny)

    by KingBahamut (615285) on Wednesday April 13 2005, @03:03PM (#12226763)
    Thats a long time, almost meets M$ standards.
    • Re:10 years? by Anonymous Coward (Score:2) Wednesday April 13 2005, @03:17PM
      • Re:10 years? by gantzm (Score:3) Wednesday April 13 2005, @03:58PM
        • Re:10 years? by KingBahamut (Score:3) Wednesday April 13 2005, @04:13PM
          • Re:10 years? by drsmithy (Score:2) Friday April 15 2005, @07:13AM
      • Re:10 years? by jweatherley (Score:3) Thursday April 14 2005, @02:12AM
  • by holymoo (660095) on Wednesday April 13 2005, @03:03PM (#12226764)
    I onced used voodoo on someone. I ended up writing a program by accident. Go Figure...
  • What's impressive (Score:4, Insightful)

    by fm6 (162816) on Wednesday April 13 2005, @03:03PM (#12226765)
    (http://picknit.com/ | Last Journal: Saturday July 29 2006, @03:58PM)
    It is impressive that these uber-hackers could figure out why the kernel was panicking. It is not impressive that NextStep and Apple have known about this panic bug for 10 years but haven't been able to fix it!
    • Re:What's impressive by b-baggins (Score:3) Wednesday April 13 2005, @03:14PM
    • Re:What's impressive (Score:5, Informative)

      by Have Blue (616) on Wednesday April 13 2005, @04:24PM (#12227686)
      (http://www.seizurerobots.com/)
      I don't see anything in TFA to indicate that Apple knew about this bug before now- he just mentions that the bug has been present with no explanation as to how this was determined. Singh even spends a good bit of text explaining how the bug is triggered by ultra-low-level routines that are not normally used by anything above the BSD layer, so I'd say there's a good chance it has never even been encountered by anyone before, if OS X's own process creation code is sufficiently solid as to never generate the inconsistency panpipes does.
      [ Parent ]
    • Re:What's impressive by HiredMan (Score:3) Wednesday April 13 2005, @04:38PM
    • Re:What's impressive (Score:5, Interesting)

      by Bastian (66383) on Wednesday April 13 2005, @08:03PM (#12229553)
      Given that the bug wouldn't be too hard to fix, and is a serious bug, I doubt that that is the case. On the contrary, while it is a bit annoying that this sort of oversight in the kernel design does exist, I think it speaks well for NeXT and Apple that they have not discovered it in all this time.

      NEXTSTEP/OS X has an incredibly layered architecture, and those layers are quite well-stratified. That stratification is a great design asset - it makes it a lot easier to keep the whole mess organized, and reduces the number of boundary conditions where bugs (such as this kernel bug :-) can pop up. Now, the fact that OS X has a sort of Mach/BSD - Jekyll/Hyde sort of thing going on in the kernel means that you should expect it to be very tempting for many developers to haphazardly make system calls as they see fit. But if that had been the way development worked at NeXT, you can bet your pants that this bug would have been discovered at least a decade ago. (Mr. Singh doesn't say exactly how far this thing goes back, but I'm going to guess it has been in NEXTSTEP the entire time - about two decades.)

      -BUT-, the bug is still there. While I normally hate old bugs as much as anyone, especially ones that cause kernel panics, in this case I am sincerely and profundly impressed at the amount of discipline that must have been present in the development culture at NeXT. (We'll see about Apple - on the inside, Classic MacOS became quite possibly the most tangled kludge of an operating system ever produced in its last few incarnations, and I do get the impression that Apple is starting to take OS X down that path, too.)
      [ Parent ]
  • by Anonymous Coward on Wednesday April 13 2005, @03:10PM (#12226857)
    I think one of the reasons why only a few people submitted their analysis was because of how the contest was structured.

    Singh said he was going to give the prize to the first person with a correct submission. Not the best submission, nor the most complete submission, or the most creative submission.

    So I think people just gave up after the first couple of submissions were posted. He shouldn't have displayed the number of submissions that had been received.

    Also, this challenge didn't hit Slashdot until after it was finished. I know I didnt' hear about it until after the first two submissions were submitted.

    It was fun to track down though.
  • How zen (Score:5, Funny)

    by daeley (126313) on Wednesday April 13 2005, @03:14PM (#12226916)
    (http://www.celsius1414.com/)
    If a bug fails in an OS, and no one finds it, does it make a sound?
    • Re:How zen by Tordek (Score:3) Wednesday April 13 2005, @03:47PM
      • Re:How zen by Golias (Score:2) Thursday April 14 2005, @12:43AM
  • NeXTSTEP had lots of bugs (Score:5, Interesting)

    by klui (457783) on Wednesday April 13 2005, @03:24PM (#12227042)
    NS had a lot of old bugs due to its use of 4.2BSD. People would report it but hardly any would get fixed/patched/updated. So I would not be surprised if some of these bugs were not purged by OS X's use of a more up-to-date version of BSD and its subsequent kernel reorg.
  • Let's all hope (Score:5, Funny)

    by amichalo (132545) on Wednesday April 13 2005, @03:55PM (#12227378)
    Hopefully Apple fixes this bug now at last.

    Man, What with blowing away their 2Q'05 earnings projections, I hope the first thing Apple does is address this bug that no one has paid any attention to in 10 years. That will make me as a Apple user and share holder happier than if they continue this "innovation" fad.
  • Nice Tie-In (Score:4, Interesting)

    by Lars T. (470328) <Lars.Traeger@goo ... m ['gle' in gap]> on Wednesday April 13 2005, @05:40PM (#12228421)
    (Last Journal: Tuesday May 15 2007, @04:19PM)
    with the Russians Claim Their Hackers the Best In the World [slashdot.org] Article - Winner is a Russian ;-)
    • Re:Nice Tie-In by Anonymous Coward (Score:1) Wednesday April 13 2005, @10:20PM
  • exploits for dummies (Score:5, Insightful)

    by epine (68316) on Wednesday April 13 2005, @10:42PM (#12230555)
    The flaw used by panpipes has existed unnoticed for over a decade. If attackers were indeed actively looking for flaws all along, did they miss this one? If nobody was ever looking for any flaws, could there be more exploitable flaws lurking?

    The rest of the article is good fun, but this passage is a brain fart. There are millions of lines of source code in any modern operating system. Exploits don't sprout overnight like mana from heaven. The most useful skill for divining exploits is to notice the existence of edge cases in how various subsystems interact with one another. There is also the important case where "chance favors the prepared mind". This is where something funny happens as a result of an honest mistake, then the "prepared mind" notices (and pursues) the chance event's darker implications.

    Serious bugs that lurk for decades are hardly unknown. The ASN.1 bug springs to mind. It's hard to image a bug more widely deployed that escaped detection for such a long time. The question here is why, for such a long time, this simple flaw evaded interactions with dark energy. It's for precisely the same reason that experts rarely make the best testers. There are certain kinds of elementary programming mistakes that the "prepared mind" will habitually avoid. This distribution has a slim tail. If the minions of evil fail to stumble into any telltale clues after five years, chances are good it will remain hidden for a long time yet.

    This is in fact the same mistake that Kurweil makes in predicting the imminent singularity: that intellectual power is a fully ordered function, based on the premise that a really smart person can achieve any interesting result that any person much less smart can achieve. To put this in perspective, consider the recently discovered AKS primality test. This is what AKS achieved by some clever tricks using concepts of undergraduate algebra and a 15-year old theorem.

    http://www.flonnet.com/fl1917/19171290.htm [flonnet.com]

    Undergraduate concepts in algebra exploited to achieve mathematical immortality. That ought to frame a tiny, unnoticed flaw in OS/X.
    • Re:exploits for dummies (Score:5, Interesting)

      by SteeldrivingJon (842919) on Thursday April 14 2005, @12:44AM (#12231047)
      (http://jonscocoa.blogspot.com/ | Last Journal: Wednesday April 13 2005, @06:12PM)
      "There are millions of lines of source code in any modern operating system. Exploits don't sprout overnight like mana from heaven. The most useful skill for divining exploits is to notice the existence of edge cases in how various subsystems interact with one another."

      Indeed. I think the problem is not that nobody was looking for flaws, but that they were looking in the parts they're familiar with. They'd be looking in the BSD-oriented parts, or the upper levels of the OS.

      They probably wouldn't be looking in the Mach parts of the OS, where this bug appears. I doubt many people have spent the time to learn enough about Mach to think of potential exploits.
      [ Parent ]
    • Re:exploits for dummies by earthbound kid (Score:1) Thursday April 14 2005, @03:33AM
  • Dr. Norton, are you paying attention? (Score:4, Interesting)

    by Anonymous Coward on Thursday April 14 2005, @02:32AM (#12231407)
    Companies who sell anti-viral software are conspicuous by their absence from the list "Net-demography of those interested".

    People in Capital One, Compound Therapeutics, Fossil, Goldman Sachs, IKEA, and SAAB were interested enough to download this, but no one from the Semantecs/Sophos/Secunas of this world found it worth their while to check it out??!!

    I would certainly hope that they are paying attention to the use of dynamic code modification, code obfuscation, and red herrings. While these techniques are not new, none of the (Windows) malware seen so far were designed to be even half as proficient in these matters as panpipes. Further, Amit has stated that he could have made panpipes even more difficult to debug (but didn't).

    Kudos to Amit for this highly educational exercise! He certainly seems to know his way about the innards of OS X (not to mention all the other OSes he runs [kernelthread.com] on his 17"PB via VPC.)

    (I bet he has some interesting insights about the evolution and workings of OSes from MS (he is running ALL the flavors of DOS [kernelthread.com] and Windows [kernelthread.com] that I know of.)

  • by theolein (316044) on Thursday April 14 2005, @05:44AM (#12231878)
    Apple should hire, even if they never hire another person for their OSX team, Amit Singh. It is truly rare that someone as gifted as this appears on the scene and then even has a passion for the intricacies of a kernel that does not garner much attention in the OSS scene.

    Given that all the immense amount of detail that Amit has given on OSX as shown on kernelthread and in his upcoming book has been done in his spare time, could you imagine what he could achieve if this was his job. Granted, I'm no HR person, but I would think that Apple should be chafing at the bit to get him on board. I know that if it was up to me, I would offer him an almost blank cheque to write his own salary on.

    He is the person who could get OSX into the enterprise.

    Of course, if he did work for Apple, then his website would surely suffer, what with NDAs and such. Perhaps it's better that he doesn't work at Apple.
  • by javaxman (705658) on Thursday April 14 2005, @02:59PM (#12237688)
    (Last Journal: Monday January 23 2006, @12:19PM)
    From a quick read of the analysis, it comes down to a system call not checking it's input values for illegal input, right ?

    If that's the only example like that which can cause a kernel panic, I'd be impressed. Especially in kernel-level I/O areas where performance is key, it's even possible that such a check is left out on purpose, and data integrity is meant to be the job of some higher-level or intermediary calling function which is ( nearly ) always used.

    Of course, I avoid programming on such a low level if possible, so I could be wrong. But it is likely there's a reason why fixing this isn't terribly important, and why my OS X machine *never* reboots unless I've done some system software update.

  • Re:To be honest (Score:4, Insightful)

    Its not like there is any software immune to ancient bugs. Debian had an outstanding bug in apt-get that was recently fixed. Apparently, for seven years there was a lurking 'ignore random files while removing a package' bug in their linked list program. Of course, it wasn't random at all, it simply skipped every other node in the linked list under certain conditions (such as having a list with more than one item).

    I don't think the person behind the challenge meant to imply that macs are toys. Only that very few people outside of Apple know much about the inner workings of their beast named OS X. As far as exploits go, a kernel panic is one of the safest out there. No way of intentionally damaging specific files, no remote execution of code. Of course, as one of the many people who doesn't know much about OSX internals, I suppose its possible that the vulnerability could lead to such things. I just don't know, and given that your name wasn't on the list, I surmise you don't either.
    [ Parent ]
  • Re:To be honest (Score:4, Insightful)

    by guet (525509) on Thursday April 14 2005, @04:06AM (#12231619)
    This adds up to the toy image _some_ claim the Macs have. Why would someone play around with a serious security bug there for 10 years? Well, a mitigating fact is that it was there for 10 years, but still it's bad to delay a fix because of a game.

    Well, apart from the attempt to disclaim responsibility for a statement whilst still presenting it as credible (the '_some_ claim' statement), there's the gratuitous insult aimed at provoking others - 'toy'.

    Why bother claiming Macs are toys in a story about an obscure bug? What does a toy mean to you? Ironically one of the most persistent criticisms of Macs is that current games don't play well on them, so they are in fact not very good toys.
    [ Parent ]
    • Re:To be honest by A beautiful mind (Score:2) Thursday April 14 2005, @07:42AM
  • 7 replies beneath your current threshold.