]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r361401:
authorAlan Somers <asomers@FreeBSD.org>
Fri, 12 Jun 2020 20:32:26 +0000 (20:32 +0000)
committerAlan Somers <asomers@FreeBSD.org>
Fri, 12 Jun 2020 20:32:26 +0000 (20:32 +0000)
commit0d7775593337bbbbe8904ff46d55aec188d5e152
tree2b99597ebfe194b33339ccecf55f7d2fc17ee022
parentfb84c33fc3b154153f6b997c65847e4bf81e6d50
MFC r361401:

Fix issues with FUSE_ACCESS when default_permissions is disabled

This patch fixes two issues relating to FUSE_ACCESS when the
default_permissions mount option is disabled:

* VOP_ACCESS() calls with VADMIN set should never be sent to a fuse server
  in the form of FUSE_ACCESS operations. The FUSE protocol has no equivalent
  of VADMIN, so we must evaluate such things kernel-side, regardless of the
  default_permissions setting.

* The FUSE protocol only requires FUSE_ACCESS to be sent for two purposes:
  for the access(2) syscall and to check directory permissions for
  searchability during lookup. FreeBSD sends it much more frequently, due to
  differences between our VFS and Linux's, for which FUSE was designed. But
  this patch does eliminate several cases not required by the FUSE protocol:

  * for any FUSE_*XATTR operation
  * when creating a new file
  * when deleting a file
  * when setting timestamps, such as by utimensat(2).

* Additionally, when default_permissions is disabled, this patch removes one
  FUSE_GETATTR operation when deleting a file.

PR: 245689
Reported by: MooseFS FreeBSD Team <freebsd@moosefs.pro>
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D24777
sys/fs/fuse/fuse_internal.c
sys/fs/fuse/fuse_vnops.c
tests/sys/fs/fusefs/access.cc
tests/sys/fs/fusefs/rename.cc
tests/sys/fs/fusefs/rmdir.cc
tests/sys/fs/fusefs/unlink.cc
tests/sys/fs/fusefs/utils.cc
tests/sys/fs/fusefs/utils.hh
tests/sys/fs/fusefs/xattr.cc