lkml.org 
[lkml]   [2009]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectbroken daemonize (COW credentials?)
Hi,

I'm observing daemonize crashes with this code:
static struct pid *pid;
static DECLARE_COMPLETION(comp);

static int bubak(void *data)
{
daemonize("bubak");
while (!signal_pending(current))
msleep_interruptible(5000);
complete_and_exit(&comp, 0);
return 0;
}

static int init1(void) <-- module_init function
{
int ret;

ret = kernel_thread(bubak, NULL, 0);
if (ret < 0)
return ret;
pid = find_get_pid(ret);
return 0;
}
----------------------- cut here -------------------

This is due to:
daemonize
-> exit_mm
-> tsk->mm = NULL; (i.e. current->mm)
-> reparent_to_kthreadd
-> commit_creds
-> set_dumpable(task->mm, suid_dumpable); (i.e. current->mm)

The culprit is probably COW credentials. David?


\
 
 \ /
  Last update: 2009-01-08 00:11    [W:0.034 / U:10.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site