The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@osdl.org>
To: Stephen Smalley <sds@epoch.ncsc.mil>
Cc: Andrew Morton <akpm@osdl.org>, James Morris <jmorris@redhat.com>,
	lkml <linux-kernel@vger.kernel.org>,
	Darrel Goeddel <dgoeddel@trustedcs.com>
Subject: Re: [PATCH 4/6] Add dynamic context transition support to SELinux
Date: Thu, 2 Dec 2004 10:34:56 -0800	[thread overview]
Message-ID: <20041202103456.O14339@build.pdx.osdl.net> (raw)
In-Reply-To: <1102002189.26015.107.camel@moss-spartans.epoch.ncsc.mil>; from sds@epoch.ncsc.mil on Thu, Dec 02, 2004 at 10:43:09AM -0500

* Stephen Smalley (sds@epoch.ncsc.mil) wrote:
> This patch for 2.6.10-rc2-mm4 adds dynamic context transition support to SELinux via

This is nice to see.

> +		/* Only allow single threaded processes to change context */
> +		if (atomic_read(&p->mm->mm_users) != 1) {
> +			struct task_struct *g, *t;
> +			struct mm_struct *mm = p->mm;
> +			read_lock(&tasklist_lock);
> +			do_each_thread(g, t)
> +				if (t->mm == mm && t != p) {
> +					read_unlock(&tasklist_lock);
> +					return -EPERM;
> +				}
> +			while_each_thread(g, t);
> +			read_unlock(&tasklist_lock);

That's heavy handed.  Can't you track this at clone time?  Or at least
do this after the AVC check, so it's not always locking task list.

thanks,
-chris
-- 
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net

  reply	other threads:[~2004-12-02 18:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-02 15:43 [PATCH 4/6] Add dynamic context transition support to SELinux Stephen Smalley
2004-12-02 18:34 ` Chris Wright [this message]
2004-12-02 18:56   ` Stephen Smalley
2004-12-02 19:18     ` Chris Wright
2004-12-02 19:50       ` Stephen Smalley
2004-12-02 20:12         ` Chris Wright

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=20041202103456.O14339@build.pdx.osdl.net \
    --to=chrisw@osdl.org \
    --cc=akpm@osdl.org \
    --cc=dgoeddel@trustedcs.com \
    --cc=jmorris@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@epoch.ncsc.mil \
    /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