From: Chris Wright <chrisw@osdl.org>
To: Guillaume Thouvenin <Guillaume.Thouvenin@Bull.net>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.6.9] fork: add a hook in do_fork()
Date: Tue, 23 Nov 2004 13:51:44 -0800 [thread overview]
Message-ID: <20041123135144.F14339@build.pdx.osdl.net> (raw)
In-Reply-To: <1101219268.6210.133.camel@frecb000711.frec.bull.fr>; from Guillaume.Thouvenin@Bull.net on Tue, Nov 23, 2004 at 03:14:28PM +0100
* Guillaume Thouvenin (Guillaume.Thouvenin@Bull.net) wrote:
> static int elsa_task_alloc_security(struct task_struct *p)
> {
> printk(KERN_ALERT "intercept a fork: %d created by %d\n",
> p->pid, p->parent->pid);
It's created by current. So, current->pid. p is not completely setup
yet, and is still largely duplication of current from dup_task_struct().
> PID PPID USER %CPU CPU COMMAND
> 2009 2008 guill 0.0 0 bash
> 2109 2108 guill 0.0 0 bash
> 2704 2109 guill 0.0 0 top
>
> and here is the message found in the kernel log:
>
> intercept a fork: 2704 created by 2108
>
> It should be 2109... not 2108
> I think that the problem occurs because the security_task_alloc() is
> called, the field p->parent is not set.
>
> Is it true? and if it is, is it possible to move the hook after the
> initialization of the variable p->parent?
No, it's correct where it is. And, IIRC, elsa is accounting related.
LSM is not the right framework, you should be using something like PAGG
or CKRM.
thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
next prev parent reply other threads:[~2004-11-23 21:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-23 6:03 Guillaume Thouvenin
2004-11-23 8:06 ` Greg KH
2004-11-23 8:56 ` Guillaume Thouvenin
2004-11-23 10:09 ` Guillaume Thouvenin
2004-11-23 14:14 ` Guillaume Thouvenin
2004-11-23 21:51 ` Chris Wright [this message]
2004-11-24 8:14 ` Guillaume Thouvenin
2004-11-23 9:03 ` Christoph Hellwig
2004-11-23 9:33 ` Guillaume Thouvenin
2004-11-23 19:31 ` Jay Lan
2004-11-23 9:59 ` Hua Zhong
2004-11-23 10:14 ` Guillaume Thouvenin
2004-11-23 13:55 ` Jan Engelhardt
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=20041123135144.F14339@build.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=Guillaume.Thouvenin@Bull.net \
--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
all inboxes | Powered by JetHome®