All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
To: Vasily Kulikov <segoon-cxoSlKxDwOJWk0Htik3J/w@public.gmane.org>
Cc: "Eric W. Biederman"
	<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>,
	Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	"Serge E. Hallyn"
	<serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-hardening-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org
Subject: Re: [PATCH/RFC] user_ns: fix missing limiting of user_ns counts
Date: Fri, 28 Dec 2012 19:21:52 +0000	[thread overview]
Message-ID: <20121228192152.GA4939@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20121228190435.GA8690@cachalot>

On Fri, Dec 28, 2012 at 11:04:35PM +0400, Vasily Kulikov wrote:

> > 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.
> 
> Understood.  How to properly fix it then?  Looks like there are quite
> many kernel structures which may reference other structures which
> indirectly reference each other via kref, IOW it is not user_ns specific
> issue.  With unprivileged user_ns the way it should be freed must be
> somehow changed.

	There are many damn good reasons why kref should *not* be used without
thinking.  It's been oversold as easy solution to all refcounting problems;
it isn't one.  Don't use it here.

WARNING: multiple messages have this Message-ID (diff)
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Vasily Kulikov <segoon@openwall.com>
Cc: kernel-hardening@lists.openwall.com,
	Containers <containers@lists.linux-foundation.org>,
	"Serge E. Hallyn" <serge.hallyn@ubuntu.com>,
	linux-kernel@vger.kernel.org,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: [kernel-hardening] Re: [PATCH/RFC] user_ns: fix missing limiting of user_ns counts
Date: Fri, 28 Dec 2012 19:21:52 +0000	[thread overview]
Message-ID: <20121228192152.GA4939@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20121228190435.GA8690@cachalot>

On Fri, Dec 28, 2012 at 11:04:35PM +0400, Vasily Kulikov wrote:

> > 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.
> 
> Understood.  How to properly fix it then?  Looks like there are quite
> many kernel structures which may reference other structures which
> indirectly reference each other via kref, IOW it is not user_ns specific
> issue.  With unprivileged user_ns the way it should be freed must be
> somehow changed.

	There are many damn good reasons why kref should *not* be used without
thinking.  It's been oversold as easy solution to all refcounting problems;
it isn't one.  Don't use it here.

WARNING: multiple messages have this Message-ID (diff)
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Vasily Kulikov <segoon@openwall.com>
Cc: kernel-hardening@lists.openwall.com,
	Containers <containers@lists.linux-foundation.org>,
	"Serge E. Hallyn" <serge.hallyn@ubuntu.com>,
	linux-kernel@vger.kernel.org,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [PATCH/RFC] user_ns: fix missing limiting of user_ns counts
Date: Fri, 28 Dec 2012 19:21:52 +0000	[thread overview]
Message-ID: <20121228192152.GA4939@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20121228190435.GA8690@cachalot>

On Fri, Dec 28, 2012 at 11:04:35PM +0400, Vasily Kulikov wrote:

> > 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.
> 
> Understood.  How to properly fix it then?  Looks like there are quite
> many kernel structures which may reference other structures which
> indirectly reference each other via kref, IOW it is not user_ns specific
> issue.  With unprivileged user_ns the way it should be freed must be
> somehow changed.

	There are many damn good reasons why kref should *not* be used without
thinking.  It's been oversold as easy solution to all refcounting problems;
it isn't one.  Don't use it here.

  reply	other threads:[~2012-12-28 19:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-28 17:56 [PATCH/RFC] user_ns: fix missing limiting of user_ns counts Vasily Kulikov
2012-12-28 17:56 ` Vasily Kulikov
2012-12-28 17:56 ` [kernel-hardening] " Vasily Kulikov
2012-12-28 18:43 ` Al Viro
2012-12-28 18:43   ` Al Viro
2012-12-28 18:43   ` [kernel-hardening] " Al Viro
     [not found]   ` <20121228184334.GZ4939-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2012-12-28 19:04     ` Vasily Kulikov
2012-12-28 19:04       ` Vasily Kulikov
2012-12-28 19:04       ` [kernel-hardening] " Vasily Kulikov
2012-12-28 19:21       ` Al Viro [this message]
2012-12-28 19:21         ` Al Viro
2012-12-28 19:21         ` [kernel-hardening] " Al Viro
2012-12-29  4:05 ` Eric W. Biederman
2012-12-29  4:05   ` Eric W. Biederman
2012-12-29  4:05   ` [kernel-hardening] " Eric W. Biederman
2012-12-29  5:13   ` Al Viro
2012-12-29  5:13     ` Al Viro
     [not found]   ` <87wqw15wqb.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-12-29  5:13     ` Al Viro
2012-12-29  5:22     ` Vasily Kulikov
2012-12-29  5:22       ` Vasily Kulikov
2012-12-29  5:22       ` [kernel-hardening] " Vasily Kulikov
2012-12-30 11:00     ` Vasily Kulikov
2012-12-30 11:00       ` Vasily Kulikov
2012-12-30 11:00       ` [kernel-hardening] " 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=20121228192152.GA4939@ZenIV.linux.org.uk \
    --to=viro-3bdd1+5odreifsdqtta3olvcufugdwfn@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
    --cc=kernel-hardening-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=segoon-cxoSlKxDwOJWk0Htik3J/w@public.gmane.org \
    --cc=serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.