LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Linux NULL pointer dereference due to incorrect proto_ops initializations (https://www.linuxquestions.org/questions/linux-security-4/linux-null-pointer-dereference-due-to-incorrect-proto_ops-initializations-747388/)

win32sux 08-13-2009 05:18 PM

Linux NULL pointer dereference due to incorrect proto_ops initializations
 
Quote:

Tavis Ormandy and [Julien Tinnes] have recently found and investigated a Linux kernel vulnerability. It affects all 2.4 and 2.6 kernels since 2001 on all architectures. [They] believe this is the public vulnerability affecting the greatest number of kernel versions.

The issue lies in how Linux deals with unavailable operations for some protocols. sock_sendpage and others don't check for NULL pointers before dereferencing operations in the ops structure. Instead the kernel relies on correct initialization of those proto_ops structures with stubs (such as sock_no_sendpage) instead of NULL pointers.
Complete Article (Please note that Linus Torvalds commited a patch for this today).

BTW, thanks to Slashdot for covering this.

bloodsugar 08-14-2009 06:30 AM

Is this a problem that your distro would issue an updated package for? or do you need to fix the problem yourself?

unSpawn 08-14-2009 06:55 AM

Distributions can backport fixes and release an updated kernel package but you can also compile the vanilla kernel.org kernel yourself if you wouldn't want to wait.

bloodsugar 08-14-2009 08:31 AM

Thanks unSpawn.

I have compiled a vanilla kernel from kernel.org in the past, however, I have not applied a fix like this before, Im guessing its a case of copying the file to the correct directory in the kernel source and compiling?

Is there a chance I could screw this up? would I be better off waiting for kernel.org to update their 2.6 kernel and then compiling that?

slimm609 08-14-2009 08:53 AM

Quote:

Originally Posted by bloodsugar (Post 3643166)
Thanks unSpawn.

I have compiled a vanilla kernel from kernel.org in the past, however, I have not applied a fix like this before, Im guessing its a case of copying the file to the correct directory in the kernel source and compiling?

Is there a chance I could screw this up? would I be better off waiting for kernel.org to update their 2.6 kernel and then compiling that?

kernel.org has applied the fix to the tree yesterday but not all vendors have a fix yet

https://bugzilla.redhat.com/show_bug.cgi?id=516949#c10

here is the recommended red hat fix for the time being. It may work on other distros since its all modprobe changes but not 100% sure. (i dont see why it wont tho)

win32sux 08-14-2009 08:57 PM

Quote:

Originally Posted by bloodsugar (Post 3643166)
I have compiled a vanilla kernel from kernel.org in the past, however, I have not applied a fix like this before, Im guessing its a case of copying the file to the correct directory in the kernel source and compiling?

Kind of. You basically download the patch, then run it through the patch program, which will apply the necessary changes to the file(s) in your source code. You can read something like this to get a better understanding of the patching process. It's actually really simple once you get the hang of it.

Quote:

Is there a chance I could screw this up? would I be better off waiting for kernel.org to update their 2.6 kernel and then compiling that?
Of course there's a chance you could screw up. BTW, what distro do you use? I ask because your distro will likely be releasing updated kernel packages soon (check with their bug tracker for relevant discussion). For what it's worth, Debian released a patched kernel package today.
Code:

win32sux@stingray:~$ uname -a
Linux stingray 2.6.26-2-486 #1 Fri Aug 14 01:02:21 UTC 2009 i686 GNU/Linux

So it looks like you've got at least three choices: wait for your distro to release an updated kernel package; wait for upstream to release a new stable source tarball; or download the current upstream stable source tarball and patch it on your own. The urgency with which you need to fix this vulnerability should probably be the determining factor.

bloodsugar 08-15-2009 11:21 AM

Quote:

Originally Posted by win32sux (Post 3643870)
You can read something like this to get a better understanding of the patching process. It's actually really simple once you get the hang of it.

Yeah that looks ok, thanks for the link :)


Quote:

Originally Posted by win32sux (Post 3643870)
BTW, what distro do you use?

slackware.

there are no packages available yet. I think I'll wait untill monday, and then have a go at it myself.

Thanks :)

GazL 08-15-2009 03:41 PM

Quote:

Originally Posted by bloodsugar (Post 3644469)

slackware.

there are no packages available yet. I think I'll wait untill monday, and then have a go at it myself.

Slackware doesn't always release new kernel packages for vulnerabilities like this one. The kernel in Slackware 12.2 is still 2.6.27.7 despite there being many local vulnerabilities fixed between that and the latest 2.6.27.29. I'm not entirely sure what Pat's criteria is for deciding whether to release an updated kernel package or not.

On the plus side, as Slackware doesn't mess with the kernel, it's relatively straight forward to build your own from the upstream sources, which is what I do.

MikeQ 08-16-2009 01:16 AM

Currently I'm running 2.6.29.6-grsec(all grsec and pax options enabled) but what I want to know is, where do I find the following so I can disable them like in the blog?

PF_APPLETALK, PF_IPX, PF_IRDA, PF_X25, PF_AX25, PF_BLUETOOTH, PF_IUCV, IPPROTO_SCTP/PF_INET6, PF_PPPOX, PF_ISDN

win32sux 08-16-2009 08:41 PM

Quote:

Originally Posted by MikeQ (Post 3644972)
Currently I'm running 2.6.29.6-grsec(all grsec and pax options enabled) but what I want to know is, where do I find the following so I can disable them like in the blog?

PF_APPLETALK, PF_IPX, PF_IRDA, PF_X25, PF_AX25, PF_BLUETOOTH, PF_IUCV, IPPROTO_SCTP/PF_INET6, PF_PPPOX, PF_ISDN

You could do kernel module blacklisting (such as suggested by Red Hat), but if you're using the latest grsecurity patch for version 2.6.29.6 you're already covered with a proper fix, so this kind of mitigation wouldn't be necessary.

At the time of this post the latest grsecurity patch for version 2.6.29.6 was:

grsecurity-2.1.14-2.6.29.6-200908140946.patch

GazL 08-17-2009 07:57 AM

2.6.27.30 and 2.6.30.5 official kernels have been released and include the fix for this issue.
Time to get compiling...

bloodsugar 08-18-2009 10:49 AM

Is it the case that when upgrading a kernel from say, my current kernel 2.6.30.2, to the new 2.6.30.5, sometimes there wont be any new kernel options when you do 'make oldconfig'?

I do the 'make oldconfig' step and it tells me 'configuration written to .config', and exits.

GazL 08-18-2009 11:37 AM

@bloodsugar, Yes, that's not unusual. Especially when only changing the minor version number.

I didn't see any new options when going to 27.30 either.

bloodsugar 08-18-2009 02:04 PM

I see, thanks Gaz,

btw, whats the 2.6.27.30 kernel?

win32sux 08-19-2009 12:01 AM

Quote:

Originally Posted by GazL (Post 3644673)
Slackware doesn't always release new kernel packages for vulnerabilities like this one. The kernel in Slackware 12.2 is still 2.6.27.7 despite there being many local vulnerabilities fixed between that and the latest 2.6.27.29. I'm not entirely sure what Pat's criteria is for deciding whether to release an updated kernel package or not.

On the plus side, as Slackware doesn't mess with the kernel, it's relatively straight forward to build your own from the upstream sources, which is what I do.

Interestingly enough, they did release one this time.


All times are GMT -5. The time now is 07:38 PM.