mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@osdl.org>
To: Andrey Savochkin <saw@saw.sw.com.sg>
Cc: Alexander Viro <viro@parcelfarce.linux.theplanet.co.uk>,
	Linus Torvalds <torvalds@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] exec: atomic MAY_EXEC check and SUID/SGID handling
Date: Thu, 2 Sep 2004 13:31:09 -0700	[thread overview]
Message-ID: <20040902133109.H1973@build.pdx.osdl.net> (raw)
In-Reply-To: <20040902174521.A13656@castle.nmd.msu.ru>; from saw@saw.sw.com.sg on Thu, Sep 02, 2004 at 05:45:21PM +0400

* Andrey Savochkin (saw@saw.sw.com.sg) wrote:
> There is a time window between permission(MAY_EXEC) check in
> open_exec() and S_ISUID check plus bprm->e_uid setting in prepare_binprm().
> And S_ISUID is checked and bprm->e_uid is copied from the inode without
> any serialization with attribute updates.
> 
> That means that some executable may have permissions
> -rwxr-xr-x    root     disk     /bin/file
> at the moment of MAY_EXEC check and
> -rwsr-x---    root     disk     /bin/file
> at the moment of S_ISUID check, providing lucky users starting /bin/file at
> the moment of permission change with a setuid-root program.
> 
> It's arguable whether it's a big security issue, but certainly such behavior
> is not what administrators may expect.

If you can find a way for a user to exploit this it's an issue.  Looks
like it's not, and doesn't warrant such a big change as your patch.
The fact that you introduce a new field and then almost always supply it
with NULL is a clue that it's not the right direction IMO.  Something
simple (as you mentioned) that grabs i_sem and rechecks during suid
setup in binprm_prepare is sufficient.  Worth it?  Guess I'm not
convinced.

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

  reply	other threads:[~2004-09-02 20:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-02 13:45 Andrey Savochkin
2004-09-02 20:31 ` Chris Wright [this message]
2004-09-03  7:21   ` Andrey Savochkin

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=20040902133109.H1973@build.pdx.osdl.net \
    --to=chrisw@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=saw@saw.sw.com.sg \
    --cc=torvalds@osdl.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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®