]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fusefs: send FUSE_OPEN for every open(2) with unique credentials
authorasomers <asomers@FreeBSD.org>
Mon, 1 Apr 2019 20:42:15 +0000 (20:42 +0000)
committerasomers <asomers@FreeBSD.org>
Mon, 1 Apr 2019 20:42:15 +0000 (20:42 +0000)
commit2c20c77440bfac65552b7ff80dcc0ef8bfe1ea35
tree2834aa680531d1c955c20b37f5241ceac976acc4
parente8363c41f2f772f302af39ee76199e9e48327e5d
fusefs: send FUSE_OPEN for every open(2) with unique credentials

By default, FUSE performs authorization in the server.  That means that it's
insecure for the client to reuse FUSE file handles between different users,
groups, or processes.  Linux handles this problem by creating a different
FUSE file handle for every file descriptor.  FreeBSD can't, due to
differences in our VFS design.

This commit adds credential information to each fuse_filehandle.  During
open(2), fusefs will now only reuse a file handle if it matches the exact
same access mode, pid, uid, and gid of the calling process.

PR: 236844
Sponsored by: The FreeBSD Foundation
sys/fs/fuse/fuse_file.c
sys/fs/fuse/fuse_file.h
sys/fs/fuse/fuse_io.c
sys/fs/fuse/fuse_io.h
sys/fs/fuse/fuse_node.c
sys/fs/fuse/fuse_node.h
sys/fs/fuse/fuse_vnops.c
tests/sys/fs/fusefs/allow_other.cc
tests/sys/fs/fusefs/open.cc