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..."
Yes, it's important to be proactive. No, such a difficult and obscure attack is not something that is priority one.
FanFictionRecs.net
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.
Looks like a variation (or maybe a dup) of this.
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!
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.
(Insert Brand Name) Anti-Virus 2008: Multi-Core version (+$25 extra per core)
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.
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
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.
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".
I almost cried.
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.
It works on any multiprocessor, including an
IBM 360/168 mainframe, where I first encountered it.
--dave
davecb@spamcop.net
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."
I am TheRaven on Soylent News
I'm a viroligist, you insensitive clod, and besides the obvious plural for virii is viruseses. Duh.
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).
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!
Of virus and the latin plural of a different
declension (the plural of masculine and feminine
words ending in -ius)
--dave
davecb@spamcop.net
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.
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.
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.
You must be new here, 'cause I see it all the time.
"[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz
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."
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.
I'm not convinced that "virii" counts as a portmanteau, which generally requires that the sound and meaning of two words are preserved.
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.