New Linux Flaw Enables Null Pointer Exploits

A researcher has published exploit code for a new vulnerability he discovered in the Linux kernel. The vulnerability is an especially interesting one in that the researcher who discovered it, Brad Spengler, has demonstrated that he can use the weakness to defeat many of the add-on security protections offered by SELinux and AppArmor.
The vulnerability affects both the 2.6.30 and 2.6.30.1 releases of the Linux kernel, and in a message to the Daily Dave mailing list Spengler said that he was able to exploit the flaw. He said that he was able to defeat the protection against exploiting NULL pointer dereferences on systems running SELinux and those running typical Linux implementations. SELinux is a set of security enhancements to the Linux OS developed by the National Security Agency.
Editor's Pick
Spengler said that when he first saw the Linux bug he knew that he would be able to get arbitrary code execution by using it. "Within about two hours I was able to get the code execution, figure out how to turn off SELinux, AppArmor and LSM," he said.
He based his exploit technique on work published last month by Julien Tinnes and Tavis Ormandy on exploiting NULL pointer derefernces in Linux, specifically.
Spengler also said he is able to turn off the auditing processes in SELinux, AppArmor and the Linux Security Module. Once SELinux was disabled, Spengler said he was able to make it appear as though the protections were still running. He posted a video demonstration of the exploit in action on YouTube.
The SANS Internet Storm Center explains how the exploit works:
"While technical details about this are a bit complex, generally what's happening can be easily explained. The vulnerable code is located in the net/tun implementation. Basically, what happens here is that the developer initialized a variable (sk in the code snippet below) to a certain value that can be NULL. The developer correctly checked the value of this new variable couple of lines later and, if it is 0 (NULL), he just returns back an error. The code looks like this:
struct sock *sk = tun->sk; // initialize sk with tun->sk
…
if (!tun)
return POLLERR; // if tun is NULL return error
This code looks perfectly ok, right? Well, it is, until the compiler takes this into its hands. While optimizing the code, the compiler will see that the variable has already been assigned and will actually remove the if block (the check if tun is NULL) completely from the resulting compiled code. In other words, the compiler will introduce the vulnerability to the binary code, which didn't exist in the source code. This will cause the kernel to try to read/write data from 0x00000000, which the attacker can map to userland – and this finally pwns the box."
There also is a separate issue that Spengler discovered with SELinux that affects multiple vendors' versions of the Linux kernel. The problem lies in the fact that in some kernel implementations, when the kernel loads the SELinux protections it overrides the NULL pointer dereference protection.
"I think that's a bigger deal probably than the other problem," Spengler said in an interview.
Until recently, exploiting NULL pointer dereferences was thought to be virtually impossible. But work done by Mark Dowd of IBM ISS last year put the lie to that. Dowd designed his technique to exploit a problem in Adobe Flash, but was able to extend it to exploit similar conditions in other applications.
Commenting on this Article is closed.
Today's Most Popular
- Researchers Discover Android Mobile Botnet 100k Strong
- Phony Temple Run Game For Android Plays On Android-iOS App Gap
- Adobe's Security Chief Talks About Driving Up The Cost of Exploits
- Hackers Hit Alabama, Mexican Government Websites
- Attackers Using Fake Google Analytics Code to Redirect Users to Black Hole Exploit Kit
Most Commented Stories
-
Attackers Using Fake Google Analytics Code to Redirect Users to Black Hole Exploit Kit (8)
-
Twenty Something Asks Facebook For His File And Gets It - All 1,200 Pages (56)
-
Did Apple, RIM and Nokia Help The Indian Government Spy On The U.S.? (3)
-
Google Begins Security Review Process for Android Apps (2)
-
Costin Raiu on the Timing of the Duqu Attacks (2)
Newsletter Sign-up
Take Our Poll
Listen to Latest Podcasts
-
-
You are missing some Flash content that should appear here! Perhaps your browser cannot display it, or maybe it did not initialize correctly.
-
You are missing some Flash content that should appear here! Perhaps your browser cannot display it, or maybe it did not initialize correctly.



