mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@osdl.org>
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>, Chris Wright <chrisw@osdl.org>,
	Stephen Smalley <sds@epoch.ncsc.mil>,
	James Morris <jmorris@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Split bprm_apply_creds into two functions
Date: Wed, 15 Dec 2004 14:52:22 -0800	[thread overview]
Message-ID: <20041215145222.V469@build.pdx.osdl.net> (raw)
In-Reply-To: <20041215200005.GB3080@IBM-BWN8ZTBWA01.austin.ibm.com>; from serue@us.ibm.com on Wed, Dec 15, 2004 at 02:00:05PM -0600

* Serge E. Hallyn (serue@us.ibm.com) wrote:
> The security_bprm_apply_creds() function is called from
> fs/exec.c:compute_creds() under task_lock(current).  SELinux must
> perform some work which is unsafe in that context, and therefore
> explicitly drops the task_lock, does the work, and re-acquires the
> task_lock.  This is unsafe if other security modules are stacked after
> SELinux, as their bprm_apply_creds assumes that the 'unsafe' variable is
> still meaningful, that is, that the task_lock has not been dropped.

I don't like this approach.  The whole point is to ensure safety, and
avoid races that have been found in the past.  This gives a new interface
that could be easily used under the wrong conditions, and breaking
the interface into two pieces looks kinda hackish.  Is there no other
solution?  I looked at this once before and wondered why task_unlock()
is needed to call avc_audit?  audit should be as lock friendly as printk
IMO, and I don't recall seeing any deadlock after short review of it.
But I didn't get much beyond that.  Is it all the flushing that can't
hold task_lock?

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

  parent reply	other threads:[~2004-12-15 22:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-15 20:00 Serge E. Hallyn
2004-12-15 21:15 ` Stephen Smalley
2004-12-16 18:25   ` Serge E. Hallyn
2004-12-17 14:10     ` Stephen Smalley
2004-12-17 17:03       ` Chris Wright
2004-12-17 19:32         ` Serge E. Hallyn
2004-12-15 22:52 ` Chris Wright [this message]
2004-12-16 12:47   ` Stephen Smalley
2004-12-16 18:16   ` Serge E. Hallyn
2004-12-16 18:16     ` Stephen Smalley
2004-12-16 18:19     ` Chris Wright
2005-01-04 18:30 [PATCH] split " Serge E. Hallyn
2005-01-04 21:41 ` Stephen Smalley
2005-01-04 21:52 ` Chris Wright
2005-01-05 23:14 ` Chris Wright
2005-01-05 23:16   ` 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=20041215145222.V469@build.pdx.osdl.net \
    --to=chrisw@osdl.org \
    --cc=akpm@osdl.org \
    --cc=jmorris@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@epoch.ncsc.mil \
    --cc=serue@us.ibm.com \
    /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®