diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2016-12-06 18:18:45 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2016-12-06 18:18:45 +0300 |
commit | c01638f5d919728f565bf8b5e0a6a159642df0d9 (patch) | |
tree | 3dc341c250252908c912ad167f49d00b2fc2c734 /fs/seq_file.c | |
parent | 3e5de27e940d00d8d504dfb96625fb654f641509 (diff) | |
download | linux-c01638f5d919728f565bf8b5e0a6a159642df0d9.tar.xz |
fuse: fix clearing suid, sgid for chown()
Basically, the pjdfstests set the ownership of a file to 06555, and then
chowns it (as root) to a new uid/gid. Prior to commit a09f99eddef4 ("fuse:
fix killing s[ug]id in setattr"), 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.
This is caused by the use of should_remove_suid(), which will always return
0 when the process has CAP_FSETID.
In fact we really don't need to be calling should_remove_suid() at all,
since we've already been indicated that we should remove the suid, we just
don't want to use a (very) stale mode for that.
This patch should fix the above as well as simplify the logic.
Reported-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: a09f99eddef4 ("fuse: fix killing s[ug]id in setattr")
Cc: <stable@vger.kernel.org>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'fs/seq_file.c')
0 files changed, 0 insertions, 0 deletions