Slashdot Mirror


Attacking Multicore CPUs

Ant writes "The Register reports that the world of current multi-core central processing units (CPUs) just entered is facing a serious threat. A security researcher at Cambridge disclosed a new class of vulnerabilities that takes advantage of concurrency to bypass security protections such as anti-virus software The attack is based on the assumption that the software that interacts with the kernel can be used without interference. The researcher, Robert Watson, showed that a carefully written exploit can attack in the window when this happens, and literally change the "words" that they are exchanging. Even if some of these dark aspects of concurrency were already known, Watson proved that real attacks can be developed, and showed that developers have to fix their code. Fast..."

49 of 167 comments (clear)

  1. Fast? by JordanL · · Score: 5, Insightful

    and showed that developers have to fix their code. Fast...
    Ummm... no. In a world where the list of things that most developers need to fix is quite lengthy, some of which renders your average app unusable or even dangerous, fixing an exploit of a hardware configuration which has no proven virii in the wild is not at the top of the list.

    Yes, it's important to be proactive. No, such a difficult and obscure attack is not something that is priority one.
    1. Re:Fast? by Anonymous Coward · · Score: 5, Informative

      "No, such a difficult and obscure attack is not something that is priority one"

      Thread one sends a command to the OS and knowing that it will take time x to complete

      Thread two waits (x-d) before overwriting the buffer used to store the command (after the OS has checked it for validity, but before the OS has actually processed it)

      what's obscure about that?

    2. Re:Fast? by Anonymous Coward · · Score: 5, Funny

      Perfect, another moron who thinks idiot is plural.

    3. Re:Fast? by g0dsp33d · · Score: 4, Insightful

      I agree. If you read the article, you'll notice that such attacks as "This was possible on both uniprocessor systems and multiprocessor systems." Also, it has been known since at least 1998. I'm guessing its not that big of a deal, because exploit code would be difficult, there are easier targets, and lastly because anti-virus software could probably still look for the code(not in real time, but only when its infected on disk or transit).

      --
      lol: You see no door there!
    4. Re:Fast? by Anonymous Coward · · Score: 2, Insightful

      Maybe because he said "think" instead of "thinks". Good job being a grammar nazi!

    5. Re:Fast? by ConceptJunkie · · Score: 2, Informative

      That would be true for "virii" only if the singular were "virius".

      --
      You are in a maze of twisty little passages, all alike.
    6. Re:Fast? by Sique · · Score: 3, Informative

      Main problem: the latin virus, meaning 'slime' or 'poison', is a singularitantum. So there is no historical plural for virus. That allows us to just make one up. And we should make it so, that it doesn't interfere with the plural of vir (man).

      --
      .sig: Sique *sigh*
    7. Re:Fast? by Foolhardy · · Score: 4, Interesting
      If that's all it is, Windows NT (and its later incarnations like XP and Vista) aren't vulnerable because kernel components facing user mode are always expected to make copies of user arguments before they're validated and used. Since the NT kernel is preemptable this would be a problem even on single CPU machines because the thread handling the syscall could be interrupted by the scheduler to execute another thread while the first was validating the arguments. Only data that is treated opaquely (e.g. a buffer to write to a file) can be accessed directly safely. This has been known and accounted for since NT was originally designed. Of course, that doesn't rule out the possibility of 3rd party developers not following the rules.

      From Common Driver Reliability Issues: User-Mode Addresses in Kernel-Mode Code

      Be prepared for changes to the contents of user-mode memory at any time; another user-mode thread in the same process might change it. Drivers must not use user-mode buffers as temporary storage, or expect the results of double fetches to yield the same results the second time.
    8. Re:Fast? by legirons · · Score: 2, Insightful

      "Windows NT (and its later incarnations like XP and Vista) aren't vulnerable because kernel components facing user mode are always expected to make copies of user arguments before they're validated and used"

      So Windows has a coding standard that says this shouldn't happen. I don't see how it necessarily follows that Windows isn't vulnerable. You're assuming that all the kernel-mode code in Windows is following the standard/reccomendation that you refer to. Let's say that even one occurance of code that doesn't meet the standard is potentially enough to do major damage (like break the most hardened-possible system). Have there been any other times when Windows code didn't follow recommended security rules? Did they make it past code-audits and onto customers' computers? What's the frequency? What's the chances of it occuring with this set of vulnerabilities?

      A phrase like "isn't vulnerable" seems awfully strong to use, when the only thing protecting against it is a warning in the developer documentation...

    9. Re:Fast? by Tim+C · · Score: 3, Informative

      Correct me if I'm wrong, but that sounds awfully similar to a race condition (it clearly isn't one, but it certainly *looks* like one), which would seem to me to mean that it would have all the same dependencies on the vagaries of system load. I'm not saying that this would be impossible to pull off, just difficult to do so consistently.

      Of course, depending on what you're actually trying to achieve, consistency may not be an issue.

    10. Re:Fast? by Foolhardy · · Score: 2, Insightful

      What I should have said is that the design of Windows NT isn't vulnerable. The article seems to be implying that this is a new sort of vulnerability, but it's not for NT because its preemptable nature has always required this to be done properly to be secure. No, I haven't personally verified the source code because I don't have access to it. Still, the core kernel team that writes such code has a good reputation for writing secure, correct code. Of all the security vulnerabilities I know of on Windows, only one is due to a syscall not validating its arguments correctly (see the NtCreateAtom bug), and only a few are in the kernel. I'm confident that guideline went into the infamous NT design book and the syscalls were audited for it, being such an obvious trust boundary. Being preemptable, race condition opportunities like this are common in NT, so I would think that the core devs would be aware of and doing this already.

      As for programs that intercept syscalls in order to filter them (e.g. on-access virus scanners) this behavior is inherently unsafe, and the kernel takes extra steps to disallow this in AMD64 versions. The chances of third party virus scanner ISVs getting this wrong is much higher than Microsoft's kernel devs.

    11. Re:Fast? by Wavicle · · Score: 2, Interesting

      Thread two waits (x-d) before overwriting the buffer used to store the command (after the OS has checked it for validity, but before the OS has actually processed it)

      Could someone explain this to me some more. In order for thread2 to write to buffer1, there must be a page table entry mapping buffer1's physical address into thread2's virtual address space.

      Are the operating systems allowing thread2 to arbitrarily change its PTEs? That sounds like the problem right there.

      --
      Education is a better safeguard of liberty than a standing army.
      Edward Everett (1794 - 1865)
    12. Re:Fast? by JoelKatz · · Score: 3, Informative

      This has nothing to do with multi-core CPUs. This exact same attack would work on the run-of-the-mill SMP systems that have been around for decades. Multi-core CPUs just make SMP systems more common.

    13. Re:Fast? by adisakp · · Score: 2, Interesting

      Since the NT kernel is preemptable this would be a problem even on single CPU machines

      From the Article (emphasis mine):

      "I was able to successfully bypass security in many system call wrappers by creating unmanaged concurrency between the attacking processes and the wrapper/kernel. This was possible on both uniprocessor systems and multiprocessor systems."

    14. Re:Fast? by petermgreen · · Score: 2, Insightful

      more common is a HUGE understatement, multicore CPUs have brought SMP from something servers and high end workstations sometimes had to something that all but the lowest end computers sold today have.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  2. err, system call wrapper runs with kernel privs? by Anonymous Coward · · Score: 2, Interesting

    Does the system call wrapper run at kernel privileges (or some elevated level giving protection from the caller), or at the privileges of the calling process? If the latter, it is of course worthless. If the former, I'm not sure how you can modify values stored in privileged space before they're sent off to the original code.

  3. Again? by DeHackEd · · Score: 5, Informative

    Looks like a variation (or maybe a dup) of this.

  4. Damn it by Frogbert · · Score: 5, Funny

    You see, Its these kind of computing professionals that make me feel like a fraud when people call me a computer genius.

    Stop raising the bar you tool!

    1. Re:Damn it by Joebert · · Score: 2, Funny

      I'm not really a Nerd, but I did stay in a Holiday Inn Express last nite.

      --
      Wanna fight ? Bend over, stick your head up your ass, and fight for air.
  5. Re:So what? by ByTor-2112 · · Score: 2, Insightful

    That's you, though. Most people believe that because they have anti-virus software they CAN safely run anything. I still find it an amusing shame that people are so willing to accept the huge performance penalties of anti-virus and now anti-spyware/adware for their utterly broken OS. Intel and AMD have to love this arms race.

  6. a dozen anti-virus companies just squealed in glee by Anonymous Coward · · Score: 2, Insightful

    (Insert Brand Name) Anti-Virus 2008: Multi-Core version (+$25 extra per core)

  7. Neither submitter nor editor RTFA...? by perrin · · Score: 4, Informative

    It seems that neither the submitter nor the slashdot editor read the article in question. The attack is not specific to multi-core systems, and it works only against programs that wrap system calls to add additional system protection. So it does not pierce through standard OS security, and you already need to have execution privileges. The writeup is just hype and FUD, IMHO.

    1. Re:Neither submitter nor editor RTFA...? by Richard+W.M.+Jones · · Score: 3, Informative

      It's also old news.

      The SELinux guys debunked it over a month ago.

      Rich.

    2. Re:Neither submitter nor editor RTFA...? by Anonymous Coward · · Score: 3, Informative

      He didn't debunk it; he agreed that system call wrappers have all kind of problems and described Watson's work as a "good paper". He then pointed out that SELinux doesn't use system call wrappers, so it doesn't have these problems. That doesn't mean the problems aren't real elsewhere.

      But I agree it's old news. It was old news ten years ago. Security has to be in the kernel. Period.

    3. Re:Neither submitter nor editor RTFA...? by Fweeky · · Score: 2, Interesting

      Erm, no, you don't need to be root to exploit these attacks, you just need to be in a situation where some security is provided by syscall wrappers. Such wrappers are sometimes used to provide an additional layer of security for applications and services; providing additional limits to what files can be read and modified, what executables can be ran, where sockets can be bound and so forth, and importantly, logging when attempts to breach these policies are attempted. You're exactly one buffer overflow away from such an exploit being a problem, since it makes that layer useless against a clueful attacker.

      That so many people are finding this attack surprising is probably a sign that there isn't enough appreciation for the security implications of concurrent systems (even if they've been known by security conscious people for many years), and that we might be finding more attacks based on them in future as more people become aware of them.

  8. The example they give is wrong by A+beautiful+mind · · Score: 4, Insightful

    to bypass security protections such as anti-virus software
    Anti-virus software isn't by any means "security protection", especially the type that works on a heuristical basis. They are simply long lists of known to be disadvantageous programs and a daemon that tries to match the list to data on the system.

    Sure, they might offer some kind of bandaid for systems operated by people who do not have the necessary knowledge to operate a computer, but it is first and foremost a security theater and it does more harm than good by providing a false sense of security.

    There are two solutions to the problem by the way. The former is educate the users and the latter is to switch to linux. No, seriously. The important part isn't linux, but switching away from a monoculture preferably to a desktop environment that is ruled by at least 3-4 systems that are different from each other and they are interoperating in well defined ways with each other. That way, you can get the platform (the systems it can possibly infect) down for a virus to a threshold where the percentage is simply too low for it to be able to spread.
    --
    It takes a man to suffer ignorance and smile
    Be yourself no matter what they say
    1. Re:The example they give is wrong by A+beautiful+mind · · Score: 2, Interesting

      Yes. Not having a mainstream OS to replace Windows with, but instead fragmenting the operating system landscape would eliminate a lot of problems. Pretty basic disease control principle: breed and use multiple types of plants and animals, so that any single disease can't kill off everything.

      --
      It takes a man to suffer ignorance and smile
      Be yourself no matter what they say
    2. Re:The example they give is wrong by tgd · · Score: 4, Insightful

      There's a billion PCs in the world -- if you think four OS's sharing 25% of that market makes it too small to be of interest to criminals, you're nuts.

      Monoculture is not the problem, although its a convenient flag to fly when "free as in beer" and "windows sux0rs" runs out.

    3. Re:The example they give is wrong by A+beautiful+mind · · Score: 3, Insightful

      Currently in this monopoly culture, the platform (systems a virus can infect) is around 35-40% at best. There are patched systems, way too old operating systems and incompatibilities between different versions of windows, so that even if Microsoft has an OS monopoly on the desktop PCs, it still does not translate into totally monolithic platforms a virus can spread from. (Paradoxically if everyone would run a subscription based OS with updates aka windows live it would make the security situation in IT much much worse. Possibly a doomsday kind of scenario for IT.)

      If an OS has 25% marketshare, it would translate to less than 10% of effective platform because of the incompatibilites between old and new versions, sane default settings and because at least some people patch their systems. As far as I know you only need to go below 10% or so to make it infeasible for a virus to spread. The virus would have to be very good at propagating in order to be able to spread at all. Think of the 10% as the number of pcs you could infect in theory, but of course if we for example talk about propagation by worm style or by spam, the real percentage is much lower since there are additional boundaries to pass, like spamfilters, even simple NAT home routers, etc. There are simply too many systems inbetween that the virus would waste time on trying to infect, so finding vulnerable systems is hard.

      Thinking about 25% in this sense suddently makes more sense doesn't it?

      --
      It takes a man to suffer ignorance and smile
      Be yourself no matter what they say
    4. Re:The example they give is wrong by tgd · · Score: 2, Insightful

      Nice try, but just FYI I ran Linux as my primary OS for over ten years until I switched to OSX, and still have a half dozen server boxes and three desktops with it here. There's one and only one Windows box in my house and thats my girlfriends' Dell which she has because a Mac was too expensive.

      Finding blind fan-boi-ism and ignorant arguments annoying doesn't make someone a Linux hater.

  9. Re:So what? by headkase · · Score: 2, Insightful

    You're ignoring the installed base of the OS. When Linux is as popular as Windows then the people writing malicious software will target it as well. They're doing it to make-money/steal-information off of you, Windows is the target now because it offers the highest return on investment. Once the Linux platform is widely popular then security tools will become relatively more necessary for it too.

    --
    Shh.
  10. Re:i wouldnt worry too much by TomV · · Score: 3, Interesting

    would only work on windows boxes anyway

    Now, I know nobody likes to be caught Reading The Fine Article, but it's maybe worth pointing out that according to The Fine Article, the exploit was demoed on Linux, FreeBSD, NetBSD, and OpenBSD. No mention of any other specific OS, though Watson did say "They should apply equally well on other operating systems".

  11. Re:So what? by Warbothong · · Score: 5, Insightful
    I remember watching an episode of the BBC's (very Microsoft dominated (as in, something major happens with Linux or Ubuntu or whatever, nothing. Some low-down Microsoft employee makes a comment about something he thinks might possibly someday become slightly relevant to some tiny niche and they spend 10 minutes on it)) Click program ( http://www.bbcworld.com/click ) and they had some "experts" (read: marketing guys) saying what the benefits of dual-core CPUs could be. All they could come up with was "You can use one core to do all of your normal activities, and use the other core to run antivirus and antispyware and firewall software constantly".

    I almost cried.

  12. Not sure that this applies to Windows... by tjstork · · Score: 2, Interesting

    The article talks about wrapping OS calls to any process, and I don't think that's something Windows can really do. Yes, there is a limited hooking facility, but I don't believe there is anything that allows a user app with admin priviledges to effectively create a subsystem on top of a subsystem, which is what this application does. There are root kits that do this sort of thing on a single call, but arranging that is rather laborious. Really, the Windows kernel just isn't accessed with a single syscall...

    --
    This is my sig.
  13. Er, that's an OLD attack by davecb · · Score: 5, Informative

    It works on any multiprocessor, including an
    IBM 360/168 mainframe, where I first encountered it.

    --dave

    --
    davecb@spamcop.net
  14. Re:i wouldnt worry too much by 0racle · · Score: 3, Insightful

    It's called a race condition and can/has affect every OS that has SMP capability.

    --
    "I use a Mac because I'm just better than you are."
  15. Re:So what? by TheRaven64 · · Score: 3, Insightful

    When Linux is as popular as Windows then the people writing malicious software will target it as well. And that's why the sensible people will also use Macs, BSD, Haiku, ReactOS, etc. A monoculture is easier to attack than a heterogeneous computing environment.
    --
    I am TheRaven on Soylent News
  16. Re:Sidebar re Virii by Nazlfrag · · Score: 3, Funny
    quote>The proper latin plural for virus is, if memory serves, virus.

    I'm a viroligist, you insensitive clod, and besides the obvious plural for virii is viruseses. Duh.

  17. Re:So what? by prator · · Score: 3, Funny

    Congratulations! This is the first time I've ever seen someone use nested parentheses in non-code. You win a set of extra parentheses keys (because (as I've noticed) you seem to use them a lot).

  18. News flash! by achurch · · Score: 4, Insightful

    In a multitasking system, you can read and write the same memory space at the same time! . . . Oh, I guess it's not news after all.

    Seriously, this is just Yet Another Race Condition. As long as you follow the rules of multithreaded programming (which for syscall wrappers means copying your arguments, since you can't negotiate mutexes with the caller), this is a non-issue.

    Neeext!

  19. Re:Sidebar re Virii by davecb · · Score: 2, Informative

    Of virus and the latin plural of a different
    declension (the plural of masculine and feminine
    words ending in -ius)

    --dave

    --
    davecb@spamcop.net
  20. Parallelism by Peaker · · Score: 2, Informative

    This should probably even work in a single-processor setup, with ordinary threads, because the user-space system call wrapper is most probably pre-emptable (How would it prevent preemption?) and thus a thread-switch can occur during the syscall wrapper code. It may be less probable, but careful timing and multiple attempts can probably achieve this same exploit on an ordinary single-processor setup.

  21. Misleading article by Anonymous Coward · · Score: 2, Informative

    From the title it seemed clear to me this article was *supposed* to be about exploits unique to SMP hardware. Yet all it really is about is generic software race conditions totally unrelated to SMP and its concurrency model.

    For those of you who didn't read the article:

    "I was able to successfully bypass security in many system call wrappers by creating unmanaged concurrency between the attacking processes and the wrapper/kernel. This was possible on both uniprocessor systems and multiprocessor systems."

    I wish people posting articles would stop with all the bullshit. Its really starting to get old.

  22. Rediscovered again by kabdib · · Score: 2, Interesting

    Nothing really new here.

    Other attacks include DMA into buffers already provided to the kernel (lots of fun with async disk and network I/O), GPU writes, OS callbacks (depends on the OS in question), and even plain vanilla threads.

    The kernel (or whatever secure subsystem you're talking about) needs to copy and verify parameters. This stuff has been known for decades. That doesn't stop weak software from being written, but it does give old farts like me a chance to kvetch :-)

    --
    Any sufficiently advanced technology is insufficiently documented.
  23. Re:So what? by mrchaotica · · Score: 2, Funny

    This is the first time I've ever seen someone use nested parentheses in non-code.

    You must be new here, 'cause I see it all the time.

    --

    "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

  24. Re:So what? by MadMidnightBomber · · Score: 2, Funny

    Fuck no. I could deploy a thousand Linux machines and never have to use the same distro/kernel/config twice. Linux rulez man!

    --
    "It doesn't cost enough, and it makes too much sense."
  25. Re:i wouldnt worry too much by sjames · · Score: 3, Interesting

    It's not even restricted to SMP. Some of the more clever hacks will work on a uniprocessor system by retrying until a context switch happens at just the right instant (or wrong instant depending on your perspective). They may stack the deck in their favor by arranging for a function call to cause a page fault. It's certainly easier to exploit with multiple processors.

    The one certainty is that this form of attack is nothing like new.

    Of course, many syscall wrappers can be bypassed by coding a syscall directly in assembly language rather than calling a library function.

    The crux of the problem for ptrace based systems is that some syscall parameters are stored in user memory. Consider the open call in an environment using ptrace for security. I write a multi-threaded app and create a buffer holding the filename. I set it to "/some/path/thats/ok" and call open. The ptrace process is notified of the call, accesses the filename parameter in my thread's memory and decides it's OK, so it calls ptrace to allow the syscall to happen (rather than nullifying or killing my process).

    IF my second thread can change the filename buffer to "/some/path/I/shouldnt/be/allowed" between the moment that the tracer decides it's OK and the moment it calls ptrace to allow it , the kernel will open the file for me and I have bypassed security.

    On a uni-processor system, I might have to make a great many attempts, but with persistance, eventually my second thread might get scheduled at just the right moment to make the change. If I succeed once, the billion failed attempts won't matter.

    The central problem in this instance is that ptrace was intended to be a debugging interface and not a security measure.

    Solving that problem could get quite complex. If the security measure must also validate data written (which could potentially be several GB), the kernel would have to make sure that no thread in any process that has access to the memory the syscall covers can be scheduled AND that no other ptrace parent of those threads can be scheduled. It can do that by walking process structs under a lock (expensive) or temporarily marking the affected pages R/O and blocking on a fault (also expensive on most archetectures). Even if such a measure is taken, it shouldn't apply to a normal ptrace since it would significantly change the behaviour of a program being debugged.

    The difficulties above are why all files that can be accessed by a system that can access classified data must also be treated as classified no matter what they are. Otherwise a badguy might manage to stuff a blob of top secret data into an unclassified file for later retrieval. Just imagine the nightmare of attempting to track classification level page by page and proving it can't do the wrong thing.

    It's related to the reason that no DRM scheme can ever provide absolute protection against a sufficiently determined copier.

    If the security is limited to parameters that have a more sane maximum size (such as a filename where MAXPATHLEN is a set value), the kernel could copy the parameter first and provide it to the tracer process using a different syscall.

    From a more theoretical POV, any OS kernel that unwisely relies on a parameter in userspace not changing between the time it validates access and the time it fulfills the request can even have it's internal access controls violated or end up getting crashed on an SMP system. That's one reason why modifying a kernel meant only for uniprocessor systems to support SMP is VERY non-trivial.

  26. Re:Sidebar re Virii by Andrew+Tanenbaum · · Score: 2, Interesting

    I'm not convinced that "virii" counts as a portmanteau, which generally requires that the sound and meaning of two words are preserved.

  27. Re:Sidebar re Virii by Protoslo · · Score: 3, Insightful

    Although it is a good guess, sadly your assumption that virus is in the fourth declension is also totally wrong. Perversely enough, it is neuter in the second even with the '-us' suffix, so the plural is actually 'vira.'

    As for 'virii,' well, my mind drew a blank, but William Whittaker's Words claims that virii is the genetive singular of 'virium,' (verdancy), the noun form of 'vireo.' As for whether that form was ever actually used, though...the perseus project server appears to be melting down, or I would check.