From: Jeff Layton <jlayton@redhat.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: FUSE: regression when clearing setuid bits on chown
Date: Mon, 05 Dec 2016 13:21:15 -0500 [thread overview]
Message-ID: <1480962075.2544.30.camel@redhat.com> (raw)
Hi Miklos,
I think we've found a "regression" that has crept in due to this patch:
commit a09f99eddef44035ec764075a37bace8181bec38
Author: Miklos Szeredi <mszeredi@redhat.com>
Date: Sat Oct 1 07:32:32 2016 +0200
fuse: fix killing s[ug]id in setattr
Basically, the pjdfstests set the ownership of a file to 06555, and then
chowns it (as root) to a new uid/gid. Prior to the patch above, fuse
would send down a setattr with both the uid/gid change and a new mode.
Now, it just sends down the uid/gid change.
Technically this is NOTABUG, since POSIX doesn't _require_ that we clear
these bits for a privileged process, but Linux (wisely) has done that
and I think we don't want to change that behavior here.
So, the issue I think is the use of should_remove_suid, which will
always return 0 when the process has CAP_FSETID. That's appropriate (I
think) for write/truncate, but not chown, where we want to ignore that.
Thoughts on the right fix here? A simple fix would be to add an
"override" bool to should_remove_suid, but maybe there's some more
elegant way to do it?
--
Jeff Layton <jlayton@redhat.com>
next reply other threads:[~2016-12-05 18:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 18:21 Jeff Layton [this message]
2016-12-06 10:02 ` FUSE: regression when clearing setuid bits on chown Miklos Szeredi
2016-12-06 12:13 ` Jeff Layton
2016-12-06 14:39 ` Miklos Szeredi
2016-12-06 14:45 ` Jeff Layton
2016-12-06 14:51 ` Miklos Szeredi
2016-12-06 14:54 ` Jeff Layton
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=1480962075.2544.30.camel@redhat.com \
--to=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=viro@zeniv.linux.org.uk \
/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).