From: Al Viro <viro@ZenIV.linux.org.uk>
To: Vasily Kulikov <segoon@openwall.com>
Cc: Containers <containers@lists.linux-foundation.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Serge Hallyn <serge.hallyn@canonical.com>,
"Serge E. Hallyn" <serge.hallyn@ubuntu.com>,
linux-kernel@vger.kernel.org,
kernel-hardening@lists.openwall.com
Subject: [kernel-hardening] Re: [PATCH/RFC] user_ns: fix missing limiting of user_ns counts
Date: Fri, 28 Dec 2012 18:43:34 +0000 [thread overview]
Message-ID: <20121228184334.GZ4939@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20121228175627.GA7683@cachalot>
On Fri, Dec 28, 2012 at 09:56:27PM +0400, Vasily Kulikov wrote:
> The included patch is a basic fix for both or them. Both values are
> hardcoded here to 100 max depth and 1000 max in total. I'm not sure how
> better to make them configurable. Looks like it needs some sysctl value
> like kernel.max_user_ns_per_user, but also something more configurable
> like new rlimit'ish limit may be created for user_ns needs. E.g. in
> case root wants one user to contain hundreds of private containers
> (container owner user), but he doesn't want anybody to fill the kernel
> with hundreds of containers multiplied by number of system users (equals
> to thousands).
I'm sorry, but this is not a solution. Kernel is not x86-only; there are
architectures with far bigger minimal stack frame size. E.g. on sparc64
every fucking stack frame is at least 176 bytes. So your 100 calls deep
call chain will happily overflow the damn stack all by itself - kernel
stack on sparc64 is 16Kb total, including struct thread_info living there.
next prev parent reply other threads:[~2012-12-28 18:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-28 17:56 [kernel-hardening] [PATCH/RFC] user_ns: fix missing limiting of user_ns counts Vasily Kulikov
2012-12-28 18:43 ` Al Viro [this message]
2012-12-28 19:04 ` [kernel-hardening] " Vasily Kulikov
2012-12-28 19:21 ` Al Viro
2012-12-29 4:05 ` Eric W. Biederman
2012-12-29 5:13 ` Al Viro
2012-12-29 5:22 ` Vasily Kulikov
2012-12-30 11:00 ` Vasily Kulikov
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=20121228184334.GZ4939@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=containers@lists.linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-kernel@vger.kernel.org \
--cc=segoon@openwall.com \
--cc=serge.hallyn@canonical.com \
--cc=serge.hallyn@ubuntu.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;
as well as URLs for NNTP newsgroup(s).