alistair23-linux/fs/fuse
Miklos Szeredi 4a2abf99f9 fuse: add FUSE_WRITE_KILL_PRIV
In the FOPEN_DIRECT_IO case the write path doesn't call file_remove_privs()
and that means setuid bit is not cleared if unpriviliged user writes to a
file with setuid bit set.

pjdfstest chmod test 12.t tests this and fails.

Fix this by adding a flag to the FUSE_WRITE message that requests clearing
privileges on the given file.  This needs 

This better than just calling fuse_remove_privs(), because the attributes
may not be up to date, so in that case a write may miss clearing the
privileges.

Test case:

  $ passthrough_ll /mnt/pasthrough-mnt -o default_permissions,allow_other,cache=never
  $ mkdir /mnt/pasthrough-mnt/testdir
  $ cd /mnt/pasthrough-mnt/testdir
  $ prove -rv pjdfstests/tests/chmod/12.t

Reported-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Tested-by: Vivek Goyal <vgoyal@redhat.com>
2019-05-27 11:42:36 +02:00
..
acl.c fuse: Support fuse filesystems outside of init_user_ns 2018-03-20 17:11:44 +01:00
control.c fuse: Convert fusectl to use the new mount API 2019-04-24 17:05:07 +02:00
cuse.c fuse: convert printk -> pr_* 2019-04-24 17:05:06 +02:00
dev.c fuse: require /dev/fuse reads to have enough buffer capacity 2019-04-24 17:05:07 +02:00
dir.c fuse: Protect fi->nlookup with fi->lock 2019-02-13 13:15:14 +01:00
file.c fuse: add FUSE_WRITE_KILL_PRIV 2019-05-27 11:42:36 +02:00
fuse_i.h fuse: allow filesystems to have precise control over data cache 2019-04-24 17:05:06 +02:00
inode.c fuse update for 5.2 2019-05-14 08:59:14 -07:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
readdir.c fuse: Protect fi->nlookup with fi->lock 2019-02-13 13:15:14 +01:00
xattr.c fuse: Ensure posix acls are translated outside of init_user_ns 2018-05-31 12:26:10 +02:00