aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-12-29 05:48:33 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2003-12-29 05:48:33 -0800
commit282ed0030c6f27691a59ebadd206f96a056a4ceb (patch)
tree9f0322e3cf1020ed561a04d7b94d87c412ad5e93 /init
parent125a4634c6d1bdf5a785ef59153324cbb844043c (diff)
downloadhistory-282ed0030c6f27691a59ebadd206f96a056a4ceb.tar.gz
[PATCH] Remove CLONE_FILES from init kernel thread creation
From: James Morris <jmorris@redhat.com> The patch below removes the CLONE_FILES flag from the kernel_thread() call which starts init. This is to prevent other kernel threads from sharing file descriptors opened by init (try 'lsof /dev/initctl' on a 2.6 system :-). The reason this patch is being proposed is so that usermode helper apps launched via kernel threads (e.g. modprobe, hotplug) do not then inherit any such file descriptors. This is not a problem in itself so far (other than being messy), but it is a problem for SELinux, which will otherwise need to grant access to /dev/initctl by modprobe and hotplug, a somewhat undesirable scenario. As far as I can tell, there is no reason why init needs to be spawned with CLONE_FILES. Please let me know if there are any objections to the change, which I would like to propose for 2.6.0+ as a cleanup.
Diffstat (limited to 'init')
-rw-r--r--init/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/init/main.c b/init/main.c
index 78536ea28c9f17..c26c0751c69f27 100644
--- a/init/main.c
+++ b/init/main.c
@@ -375,7 +375,7 @@ static void __init smp_init(void)
static void rest_init(void)
{
- kernel_thread(init, NULL, CLONE_KERNEL);
+ kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND);
unlock_kernel();
cpu_idle();
}