Attacking Multicore CPUs 167
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..."
Fast? (Score:5, Insightful)
Yes, it's important to be proactive. No, such a difficult and obscure attack is not something that is priority one.
Re:Fast? (Score:5, Informative)
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?
Re:Fast? (Score:5, Interesting)
From Common Driver Reliability Issues: User-Mode Addresses in Kernel-Mode Code [microsoft.com]
Re: (Score:3, Insightful)
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 do
Re: (Score:3, Insightful)
Re: (Score:3, Interesting)
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."
Re:Fast? (Score:4, Informative)
Of course, depending on what you're actually trying to achieve, consistency may not be an issue.
Re: (Score:3, Interesting)
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.
Re: Fast? (Score:2)
The blurb mentions Anti-Vi
Re:Fast? (Score:4, Informative)
Re: (Score:3, Insightful)
Re: (Score:2)
Two cores, one cache.
Or sometimes, two cores, two L1 caches, two L2 caches, one L3 cache.... Either way, the only thing symmetrical about them are the execution units, and not the whole processor.
Re: (Score:2)
Do you have a different definition and if so what is it?
Re: (Score:2)
I was being a little more specific though, probably to a fault. To me, SMP implies that you can schedule workloads on the CPUs as equals. If you have two shared-cache multi-core packages in one system, however, the system has some NUMA-like scheduling behaviors.
Re:Fast? (Score:5, Insightful)
Re: (Score:2)
Re:Fast? (Score:5, Funny)
Re: (Score:2, Insightful)
Re: (Score:2)
Sidebar re Virii (Score:2, Informative)
Of course it's a word, it's a portmanteau word. A colleague and I made it up years ago, to see how many folks would thnk it was the proper latin tag for the little monsters.
The proper latin plural for virus is, if memory serves, virus.
--dave
Re:Sidebar re Virii (Score:4, Funny)
I'm a viroligist, you insensitive clod, and besides the obvious plural for virii is viruseses. Duh.
Re: (Score:3, Insightful)
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 woul
Re: (Score:3, Informative)
declension (the plural of masculine and feminine
words ending in -ius)
--dave
Re: (Score:2, Interesting)
Re: (Score:2)
What's a proper term for mock latinate, I wonder (;-))
--dave
Re:Fast? (Score:4, Informative)
Re: (Score:2)
"There is another organism on this planet that follows the same pattern. Do you know what it is? A virus. Human beings are a disease, a cancer of this planet. You're a plague and we are the cure."
- Agent Smith
Re: (Score:2)
Re: (Score:3, Informative)
Re: (Score:2)
err, system call wrapper runs with kernel privs? (Score:2, Interesting)
Re:err, system call wrapper runs with kernel privs (Score:2)
Re: (Score:2)
Unless I'm misunderstanding the issue, this seems like a completely irrelevant exploit. More accurately, it seems to be about the least efficient way possible to achieve this goal. If you already have injected virus code running in a separate thread inside a process, you don't have to intercept the system call and overwrite the data at all. You can just ask the system to grant write permission to the TEXT pages and change the system call to call into your own function that mucks with the values, calla th
Multicore? (Score:1, Insightful)
Multiprocessor systems are marginally easier to exploit since they do not require forcing kernel context switches via paging or other techniques. However, I was able to successfully bypass the same wrappers on uniprocessor systems. I did my experimental work on Intel hardware, but they should work across a range of hardware architectures and configurations.
Again? (Score:5, Informative)
Re: (Score:2)
Re: (Score:2)
Damn it (Score:5, Funny)
Stop raising the bar you tool!
Re: (Score:2)
Re: (Score:3, Funny)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Ha! And the professor had me fail the Computer History class! I still know everything!
a dozen anti-virus companies just squealed in glee (Score:2, Insightful)
Neither submitter nor editor RTFA...? (Score:5, Informative)
Re: (Score:2)
I fixed that for you.
Re: (Score:2)
Re:Neither submitter nor editor RTFA...? (Score:4, Informative)
It's also old news [slashdot.org].
The SELinux guys debunked it [livejournal.com] over a month ago.
Rich.
Re: (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.
Re: (Score:2)
Re: (Score:2)
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.
Or one could look at it as standard OS security not being flexible or modifiable enough for the real world. The reason why these syscall intercepts in-process or in another process are used is because the system security doesn't do what is needed and can't be modified dynamically. The reason these things exist is because it is far easier to do these checks in user-space. I would certainly say it is a technical weakness that one has to be a skilled kernel developer and create a patch for the kernel and r
Re: (Score:3, Interesting)
The example they give is wrong (Score:5, Insightful)
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.
Re:The example they give is wrong (Score:5, Insightful)
Monoculture is not the problem, although its a convenient flag to fly when "free as in beer" and "windows sux0rs" runs out.
Re: (Score:2, Insightful)
The point
Re: (Score:3, Insightful)
Finding blind fan-boi-ism and ignorant arguments annoying doesn't make someone a Linux hater.
Re:The example they give is wrong (Score:4, Insightful)
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?
Re: (Score:2)
(you thought it was hard getting games to run on linux - try getting games to r
Re: (Score:2)
Re: (Score:2)
I wonder why that incorrect post is modded +5.
Heuristic scanning is the opposite of "long lists of known to be disadvantageous programs".
It is a form of pro-active security analyzing the behavior and features of an unknown program WITHOUT any lists of known viruses. For example, does the program hook the keyboard and adds i
Re: (Score:2)
I'm aware, the phrasing was maybe a bit confusing. I should have written something to the effect of "even the traditional list based method is quite inefficient and broken, but heuristic scanning even more so". The reason is because while in the case of lists it's trying to identify programs that cause harm, in the heuristic case it is trying to judge _intent_ of the programs.
A virus is just simply a user mode appl
Re: (Score:3, Interesting)
Re: (Score:2)
In the end abstraction layers would form where viruses could still spread. If everyone had a unique OS, but ran a web browser that supported Javascript, then people would develop Javascript viruses.
Not sure that this applies to Windows... (Score:2, Interesting)
Er, that's an OLD attack (Score:5, Informative)
IBM 360/168 mainframe, where I first encountered it.
--dave
Re: (Score:2)
The room was dominated by the 360 (/75,
I think) so I misassociated the little
168 with it (;-))
--dave
News flash! (Score:5, 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!
Re: (Score:2)
This is only a problem if your syscall wrapper didn't take this into consideration. If you're writing a syscall wrapper for security reasons, you don't pass parameters that the original caller still has write access to.
Parallelism (Score:3, Informative)
Re: (Score:2)
If it is kernel-mode, how does it use another thread of execution to overwrite the temporary copy made in the kernel?
Misleading article (Score:2, Informative)
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 wi
Well, it was almost English. (Score:2)
Rediscovered again (Score:3, Interesting)
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
Ahem. (Score:2)
What's this about attacking multi-core processors?
The processors aren't broken, you could race a process in a uni and SMP system just the same. And in reality, your syscall security should be in there kernel itself, where any copies taken of data are passed internally to
How hard can it be? (Score:2)
Similar attack exists on single CPU with DMA I/O (Score:2)
They were able to crack the system by setting up a DMA based read. Then they called the kernel with some kernel call parameters. The kernel checked the parameters. And then the DMA input rolled new values onto those parameters.
This, of course, took some careful timing.
And it relied on kernel weakness - the weakness of leaving the user parameters in
RTFA - not SMP specific (Score:2)
So, this doesn't protect UP systems at all. preempt already exposes you to these kind of concurrency issues, and one can only assume that pretty much any RT OS also is vulnerable.
Vague; unsubstantiated..."race" conditions? oh my! (Score:2)
The article mentions *nix based systems, but talks about Anti-Vir sw that layers on top of the
OS. The layered AV SW, sounds like a windows problem.
While there are race conditions possible with many security solutions due to the fact that they are not bound into the kernel, none of the problems are new with "multi-core" than with other "MP" machines (computers did have multiple "Cores" (CPUs) in the past -- just not on one chip).
The article is
Re: (Score:3, Insightful)
Re: (Score:3, Insightful)
Re:So what? (Score:4, Insightful)
Re: (Score:3, Funny)
Re: (Score:2)
Re:So what? (Score:5, Insightful)
I almost cried.
Re: (Score:2)
Re:So what? (Score:4, Funny)
Re: (Score:3, Funny)
You must be new here, 'cause I see it all the time.
Re: (Score:2)
(Anyone who has used lisp would get the joke I was trying for)
Re: (Score:2)
Re: (Score:2)
This from a Slashdot reader with a 5 digit UID?
Either you're lying just so you could make the joke, or Alzheimer's is setting in.
-
Re: (Score:2)
Re: (Score:2)
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.
AV software isn't protectng your from problems in the OS, it's protecting you from problems in the user.
No amount of OS security can stop the user from deliberately doing something stupid - nor should it.
Re: (Score:3, Interesting)
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".
Re:i wouldnt worry too much (Score:4, Insightful)
Re: (Score:2)
Re: (Score:2)
Re:i wouldnt worry too much (Score:4, 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.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
It's not a new class, CVE-2006-0457 [nist.gov] is in the same category, for instance.