]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix issues with FUSE_ACCESS when default_permissions is disabled
authorasomers <asomers@FreeBSD.org>
Fri, 22 May 2020 18:11:17 +0000 (18:11 +0000)
committerasomers <asomers@FreeBSD.org>
Fri, 22 May 2020 18:11:17 +0000 (18:11 +0000)
commit3d01fab1022d22f2e086bdeaa73d32a44fef29c1
treedf136e00e8cf90d8c6ecad653adb37a3bd81e487
parente7c45f4413c2d9e3d3356a1c5e285fe9684e28a0
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
MFC after: 2 weeks
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