mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Solar Designer <solar@openwall.com>
Cc: Alex Riesen <fork0@users.sourceforge.net>,
	Willy Tarreau <wtarreau@hera.kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] set*uid() must not fail-and-return on OOM/rlimits
Date: Sun, 20 Aug 2006 17:53:22 +0200	[thread overview]
Message-ID: <1156089203.23756.46.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <20060820153037.GA20007@openwall.com>

On Sun, 2006-08-20 at 19:30 +0400, Solar Designer wrote:
> On Sun, Aug 20, 2006 at 12:07:06PM +0200, Alex Riesen wrote:
> > Solar Designer, Sun, Aug 20, 2006 02:38:40 +0200:
> > > Attached is a trivial patch (extracted from 2.4.33-ow1) that makes
> > > set*uid() kill the current process rather than proceed with -EAGAIN when
> > > the kernel is running out of memory.  Apparently, alloc_uid() can't fail
> > > and return anyway due to properties of the allocator, in which case the
> > > patch does not change a thing.  But better safe than sorry.
> > 
> > Why not ENOMEM?
> 
> ENOMEM would not be any better than EAGAIN from the security standpoint.
> 
> The problem is that there are lots of privileged userspace programs that
> do not bother to check the return value from set*uid() calls (or
> otherwise check that the calls succeeded) before proceeding with work
> that is only safe to do with the *uid switched as intended.

sounds like a good argument to get the setuid functions marked
__must_check in glibc...

-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com


  reply	other threads:[~2006-08-20 15:54 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-20  0:38 Solar Designer
2006-08-20  7:52 ` Kari Hurtta
2006-08-20 18:10   ` Alan Cox
2006-08-21  5:05     ` Kari Hurtta
2006-08-20  8:26 ` Willy Tarreau
2006-08-20 15:25   ` Solar Designer
2006-08-20 10:07 ` Alex Riesen
2006-08-20 15:30   ` Solar Designer
2006-08-20 15:53     ` Arjan van de Ven [this message]
2006-08-20 16:17       ` Willy Tarreau
2006-08-20 16:28       ` Ulrich Drepper
2006-08-20 16:45         ` Arjan van de Ven
2006-08-20 16:47         ` Michael Buesch
2006-08-20 16:48         ` Solar Designer
2006-08-20 18:03     ` Alan Cox
2006-08-20 18:10       ` Willy Tarreau
2006-08-20 18:36         ` Alan Cox
2006-08-20 18:21           ` Willy Tarreau
2006-08-20 18:52             ` Alan Cox
2006-08-20 19:01               ` Willy Tarreau
2006-08-20 19:33                 ` Alan Cox
2006-08-20 19:17                   ` Willy Tarreau
2006-08-20 16:04 ` Florian Weimer
2006-08-20 16:25   ` Solar Designer
2006-08-20 18:14 ` Alan Cox
2006-08-20 22:12   ` Solar Designer
2006-08-20 22:51     ` Alan Cox
2006-08-20 22:58       ` Solar Designer
2006-08-20 23:00       ` Alan Cox
2006-08-21  0:23       ` Peter Williams
2006-08-21  0:45         ` Solar Designer

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=1156089203.23756.46.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=fork0@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=solar@openwall.com \
    --cc=wtarreau@hera.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®