From: Jiri Slaby <jirislaby@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
James Morris <jmorris@namei.org>
Subject: broken daemonize (COW credentials?)
Date: Thu, 08 Jan 2009 00:08:09 +0100 [thread overview]
Message-ID: <496535D9.6040606@gmail.com> (raw)
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?
next reply other threads:[~2009-01-07 23:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-07 23:08 Jiri Slaby [this message]
2009-01-08 11:15 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=496535D9.6040606@gmail.com \
--to=jirislaby@gmail.com \
--cc=dhowells@redhat.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome