From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
Cc: Andrew Morton <akpm@osdl.org>, Greg KH <greg@kroah.com>,
lkml <linux-kernel@vger.kernel.org>,
elsa-devel <elsa-devel@lists.sourceforge.net>,
Gerrit Huizenga <gh@us.ibm.com>,
Erich Focht <efocht@hpce.nec.com>
Subject: Re: [PATCH 2.6.11-rc3-mm2] connector: Add a fork connector
Date: Mon, 21 Feb 2005 11:41:32 +0300 [thread overview]
Message-ID: <1108975292.6728.13.camel@uganda> (raw)
In-Reply-To: <1108969656.8418.59.camel@frecb000711.frec.bull.fr>
[-- Attachment #1: Type: text/plain, Size: 3032 bytes --]
On Mon, 2005-02-21 at 08:07 +0100, Guillaume Thouvenin wrote:
> On Thu, 2005-02-17 at 18:50 +0300, Evgeniy Polyakov wrote:
> > On Thu, 2005-02-17 at 15:55 +0100, Guillaume Thouvenin wrote:
> > > It's a new patch that implements a fork connector in the
> > > kernel/fork.c:do_fork() routine. The connector sends information about
> > > parent PID and child PID over a netlink interface. It allows to several
> > > user space applications to be alerted when a fork occurs in the kernel.
> > > The main drawback is that even if nobody listens, a message is send. I
> > > don't know how to avoid that. I added an option (FORK_CONNECTOR) to
> > > enable the fork connector (or disable) when compiling the kernel. To
> > > work, connector must be compiled as built-in (CONFIG_CONNECTOR=y). It
> > > has been tested on a 2.6.11-rc3-mm2 kernel with two user space
> > > applications connected.
> > >
> > > It is used by ELSA to manage group of processes in user space. In
> > > conjunction with a per-process accounting information, like BSD or CSA,
> > > ELSA provides a per-group of processes accounting.
> >
> > I think people will complain here...
> > ... [cut here] ...
> > I still think that lsm with all calls logging is the best way to
> > achieve this goal.
>
> I agree with you. My first implementation was with LSM but Chris Wright
> (I think it was him) notice that it's not the right framework (and it
> seems true). So I looked for another solution. I though about kobject
> but it was too "big" and finally, Greg KH spoke about connectors. It's
> small and efficient.
Your do_fork() change really looks like either audit addon(but it is
really
not the case) or LSM logging facility.
I think adding cn_netlink_send() in every function in security/dummy.c
and renaming it to security/cn_logger.c or something is not such a bad
idea...
Or even wait in each function until userspace replies with the decision
to
allow or not such call.
Although it can create a lock (need to recheck security hooks in
send/recv pathes).
> > from the other side why only fork is monitored in this way?
>
> The problem is the following: I have a user space daemon that manages
> group of processes. The main idea is, if a parent belongs to a group
> then its child belongs to the same group. To achieve this I need to know
> when a fork occurs and which processes are involved. I don't see how to
> do this without a hook in the do_fork() routine... Any ideas are
> welcome.
Now I begin to understand Chris Wright - LSM are designed not for
monitoring,
but only for initialisation path - i.e. LSM will say only if something
is allowed or not,
but not if it was performed.
So, for exactly your setup there is no any other way then to patch
do_fork().
> Thank you Evgeniy for all your comments about the code, it helps and I
> will modify the patch.
>
> Regards,
> Guillaume
--
Evgeniy Polyakov
Crash is better than data corruption -- Arthur Grabowski
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-02-21 8:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-17 14:55 [PATCH 2.6.11-rc3-mm2] connector: Add a fork connector Guillaume Thouvenin
2005-02-17 15:50 ` Evgeniy Polyakov
2005-02-21 7:07 ` Guillaume Thouvenin
2005-02-21 8:41 ` Evgeniy Polyakov [this message]
2005-02-21 9:47 ` Paul Jackson
2005-02-21 10:33 ` Guillaume Thouvenin
2005-02-21 11:58 ` Paul Jackson
2005-02-21 14:43 ` Guillaume Thouvenin
2005-02-21 16:55 ` Erich Focht
2005-02-21 17:54 ` Paul Jackson
2005-02-21 8:05 ` [Elsa-devel] " Guillaume Thouvenin
2005-02-21 8:48 ` Evgeniy Polyakov
[not found] <1108649153.8379.137.camel@frecb000711.frec.bull.fr>
2005-02-23 8:52 ` Guillaume Thouvenin
2005-02-23 9:07 ` Andrew Morton
2005-02-23 11:08 ` Evgeniy Polyakov
2005-02-23 10:58 ` Andrew Morton
2005-02-23 11:41 ` Evgeniy Polyakov
2005-02-24 6:41 ` Guillaume Thouvenin
2005-02-24 9:17 ` Evgeniy Polyakov
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=1108975292.6728.13.camel@uganda \
--to=johnpol@2ka.mipt.ru \
--cc=akpm@osdl.org \
--cc=efocht@hpce.nec.com \
--cc=elsa-devel@lists.sourceforge.net \
--cc=gh@us.ibm.com \
--cc=greg@kroah.com \
--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