linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jeff.layton-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>
To: "J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Linux Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	Benjamin Coddington
	<bcodding-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"Eric W. Biederman"
	<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>,
	Dmitry Vyukov <dvyukov-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Subject: Re: [RFC][PATCH] locks: Allow disabling mandatory locking at compile time
Date: Wed, 11 Nov 2015 20:55:22 -0500	[thread overview]
Message-ID: <20151111205522.5aa77435@synchrony.poochiereds.net> (raw)
In-Reply-To: <20151112013311.GA32064-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>

On Wed, 11 Nov 2015 20:33:11 -0500
"J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org> wrote:

> On Wed, Nov 11, 2015 at 05:22:33PM -0600, Eric W. Biederman wrote:
> > Jeff Layton <jeff.layton-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org> writes:
> > 
> > > On Wed, 11 Nov 2015 15:26:07 -0500
> > > "J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org> wrote:
> > >
> > >> On Wed, Nov 11, 2015 at 11:49:20AM -0600, Eric W. Biederman wrote:
> > >> > 
> > >> > Mandatory locking appears to be almost unused and buggy and there
> > >> > appears no real interest in doing anything with it.  Since effectively
> > >> > no one uses the code and since the code is buggy let's allow it to be
> > >> > disabled at compile time.  I would just suggest removing the code but
> > >> > undoubtedly that will break some piece of userspace code somewhere.
> > >> > 
> > >> > For the distributions that don't care about this piece of code
> > >> > this gives a nice starting point to make mandatory locking go away.
> > >> > 
> > >> > Cc: Benjamin Coddington <bcodding-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > >> > Cc: Dmitry Vyukov <dvyukov-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> > >> > Cc: Jeff Layton <jeff.layton-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>
> > >> > Cc: J. Bruce Fields <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
> > >> > Signed-off-by: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
> > >> > ---
> > >> > 
> > >> > A piece of userspace software having problematic interactions with
> > >> > mandatory locking recently came up as an issue
> > >> 
> > >> Is there any more interesting story there?
> > 
> > Only that I overlooked them when implementing user namespace support for
> > mounting filesystems so it is currently possible to without privilege to
> > mount tmpfs with mandatory locking enabled and pass a file descriptor to
> > a daemon that was not expecting them.  Causing nice denial of service
> > attacks.
> > 
> > So I need to decide what to do with mandatory locking in user
> > namespaces.
> > 
> > As the consensus of this thread is that users of mandatory locking are
> > as rare as hen's teeth I can just not allow mandatory locking if you
> > something is being mounted just user namespace permissions.
> 
> Sounds like a plan.  If nobody notices this limitation then that's
> further evidence that we might be able to get away with deprecating it
> eventually.
> 
> (Well, I wouldn't be surprised if there's some test suite somewhere that
> includes a simple test for mandatory lock enforcement.  So, any user
> other than that....)
> 

Yeah, ISTR that there are some (maybe in LTP)?

Still, we have all sorts of options to disable pieces of the kernel
these days for the tinification effort. This is just another.

Heck, we've already had CONFIG_FILE_LOCKING forever, so allowing people
to disable just mandatory locking seems harmless enough.

-- 
Jeff Layton <jeff.layton-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>

  parent reply	other threads:[~2015-11-12  1:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 17:49 [RFC][PATCH] locks: Allow disabling mandatory locking at compile time Eric W. Biederman
2015-11-11 20:26 ` J. Bruce Fields
2015-11-11 22:44   ` Jeff Layton
2015-11-11 22:46     ` Jeremy Allison
2015-11-11 23:22     ` Eric W. Biederman
2015-11-12  1:33       ` J. Bruce Fields
     [not found]         ` <20151112013311.GA32064-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2015-11-12  1:55           ` Jeff Layton [this message]
2015-11-16 14:58       ` Jeff Layton
2015-11-16 21:34         ` Eric W. Biederman

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=20151111205522.5aa77435@synchrony.poochiereds.net \
    --to=jeff.layton-7i+n7zu2hftekmmhf/gkza@public.gmane.org \
    --cc=bcodding-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=dvyukov-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@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 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).