]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fuse: Fail all requests with invalid uids or gids
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 21 Feb 2018 16:52:06 +0000 (10:52 -0600)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 20 Mar 2018 16:11:44 +0000 (17:11 +0100)
commitc9582eb0ff7d2b560be60eafab29183882cdc82b
tree2622564e341542e5e23140deb6194f23d4eabec2
parentdbf107b2a7f36fa635b40e0b554514f599c75b33
fuse: Fail all requests with invalid uids or gids

Upon a cursory examinination the uid and gid of a fuse request are
necessary for correct operation.  Failing a fuse request where those
values are not reliable seems a straight forward and reliable means of
ensuring that fuse requests with bad data are not sent or processed.

In most cases the vfs will avoid actions it suspects will cause
an inode write back of an inode with an invalid uid or gid.  But that does
not map precisely to what fuse is doing, so test for this and solve
this at the fuse level as well.

Performing this work in fuse_req_init_context is cheap as the code is
already performing the translation here and only needs to check the
result of the translation to see if things are not representable in
a form the fuse server can handle.

[SzM] Don't zero the context for the nofail case, just keep using the
munging version (makes sense for debugging and doesn't hurt).

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dev.c