The "NULL pointer dereference" bug has been confirmed in versions 2.6.30
and 2.6.30.1 of the Linux kernel
Full story here:
http://www.theregister.co.uk/2009/07/17/linux_kernel_exploit/
Keep in mind that the bug is only affecting if you have tun module loaded, and
most normal users don't use bridged networks and it's still a local exploit,
so the effects are slim for the Linux community.
--
//Aho
A bigger question to me is what compiler was used. In
what case can "optimization" remove some test like:
if(!pointer).....
If a pointer is used in an assignment and then later checked against
NULL, but without modification, the compiler could remove the check as
it would assume it contained a valid (non-NULL) value.
...
struct sock *sk = tun->sk;
unsigned int mask = 0;
if (!tun)
...
tun has been used to assign sk before it is checked.
See:
http://xorl.wordpress.com/2009/07/17/linux-kernel-devnettun-null-pointer-dereference/
or
OK, when I see the code it is clear to me that the
problem is the code and not the compiler, and it
has nothing to do with optimization.
Thanks for the reference.
I agree. The fact that the variable is used as a pointer before it is
checked for validity is POOR code.
The optimization seems reasonable. The code doesn't.