From: Solar Designer <solar@openwall.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: 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: Mon, 21 Aug 2006 02:58:10 +0400 [thread overview]
Message-ID: <20060820225810.GA22052@openwall.com> (raw)
In-Reply-To: <1156114275.4051.71.camel@localhost.localdomain>
On Sun, Aug 20, 2006 at 11:51:15PM +0100, Alan Cox wrote:
> A lot of
> BSD code for example doesn't check malloc returns but you don't want an
> auto-kill if mmap fails ?
That's quite different in that things happen to be fail-close anyway:
malloc() returns NULL, a program does not check for that but tries to
access memory via the pointer - and almost definitely crashes. Yes,
there are special cases when only *(p + large_value) is accessed and
thus there might be misbehavior rather than crash, but those cases are
very uncommon.
> The kill has the advantage that it stops the situation but it may also
> be that you kill a program which can handle the case and you create a
> new DoS attack (eg against a daemon switching to your uid).
I doubt it (speaking of 2.4 and the proposed patch only). The error
path that I proposed to change from EAGAIN to kill is only potentially
invoked when the kernel is running out of memory so badly that the
entire system is essentially already DoS'ed.
As it relates to fixing 2.6, I would _not_ propose killing the process
when it is about to exceed RLIMIT_NPROC. Instead, I would propose that
the RLIMIT_NPROC check be removed (to match the behavior of 2.4 and
earlier kernels) or moved to execve (to match -ow patches with this
option enabled).
> The current
> situation is not good, the updated situation could be far worse.
Well, I disagree.
> The message is important, we want to know it happened in the memory
> shortage case anyway.
This I agree with.
> Containers are also likely to create more such problems.
Implementations should be careful to not break expectations of existing
application programs in dangerous ways.
Thanks,
Alexander
next prev parent reply other threads:[~2006-08-20 23:04 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-20 0:38 [PATCH] set*uid() must not fail-and-return on OOM/rlimits 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
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 [this message]
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=20060820225810.GA22052@openwall.com \
--to=solar@openwall.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--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