Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274887 - sys-kernel/hardened-sources-2.6.28-r9 should have patched security/selinux/hooks.c
Summary: sys-kernel/hardened-sources-2.6.28-r9 should have patched security/selinux/ho...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: The Gentoo Linux Hardened Kernel Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-21 01:09 UTC by Longpoke
Modified: 2011-01-21 12:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
.config used at the time (config,61.55 KB, text/plain)
2009-06-21 01:09 UTC, Longpoke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Longpoke 2009-06-21 01:09:02 UTC
If you are running r9, there is a bug in security/selinux/hooks.c that will cause kernel panics for various reasons, eg if you try to resolve a hostname before a /etc/resolve.conf is filled.

Steps to reproduce:
1. Compile kerenel with my config (see next attachment)
2. echo > /etc/resolve.conf:
3. Compile and run:
#include <netdb.h>

int main(int argc, char *argv[])
{
	gethostbyname("google.com");
	return 0;
}
4. Kernel panic

Workaround:
cat "nameserver 1.2.3.4" > /etc/resolv.conf

Real Fix:
http://patchwork.kernel.org/patch/29146/

This patch fixes a bug in "the compat_net code", which is deprecated and was removed from newer kernels, but is in hardened-sources-2.6.28-r9.

I encountered this problem on my amd64 machine, and my friend gets the same problem on a hardened x86 server with the same kernel version. This patch fixes it.
Comment 1 Longpoke 2009-06-21 01:09:37 UTC
Created attachment 195312 [details]
.config used at the time
Comment 3 awefjio 2009-06-28 21:05:40 UTC
I am able to reproduce this critical bug. The patch fixes the problem for me.
Comment 4 awefjio 2009-06-28 21:06:20 UTC
I am able to reproduce this critical bug. The patch fixes the problem for me.
Comment 5 Wolfram Schlich (RETIRED) gentoo-dev 2009-08-27 09:10:11 UTC
Does this only happen with SELinux actually *enabled*?
Comment 6 Ewald Tienkamp 2009-12-11 00:07:18 UTC
I would like to add that this problem still exists.

It presented itself as KSplash locking up: a full system freeze (so, probably, a kernel panic in the background).

Using sys-kernel/hardened-sources-2.6.28-r9.

Resolved by using the workaround suggested in comment #2, which is booting the kernel with selinux_compat_net=0 as additional parameter in Grub.
Comment 7 Anthony Basile gentoo-dev 2010-07-08 10:59:37 UTC
The latest stable hardened-source is 2.6.32-r9.  It should have the patch in Comment #1.  Would the reporter please test it and see if this issue still persists. 
Comment 8 Anthony Basile gentoo-dev 2011-01-21 12:01:50 UTC
This kernel is off the tree so I'm closing this bug.