Commit c01638f
Miklos Szeredi
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 a09f99e ("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: a09f99e ("fuse: fix killing s[ug]id in setattr")
Cc: <stable@vger.kernel.org>
Reviewed-by: Jeff Layton <jlayton@redhat.com>1 parent 3e5de27 commit c01638f
1 file changed
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1739 | 1739 | | |
1740 | 1740 | | |
1741 | 1741 | | |
1742 | | - | |
1743 | | - | |
1744 | 1742 | | |
1745 | 1743 | | |
1746 | 1744 | | |
| |||
1750 | 1748 | | |
1751 | 1749 | | |
1752 | 1750 | | |
1753 | | - | |
1754 | | - | |
| 1751 | + | |
1755 | 1752 | | |
1756 | 1753 | | |
1757 | 1754 | | |
1758 | | - | |
| 1755 | + | |
1759 | 1756 | | |
1760 | 1757 | | |
1761 | 1758 | | |
| |||
0 commit comments