• Ben Hutchings's avatar
    nfsd: check permissions when setting ACLs · 99965378
    Ben Hutchings authored
    Use set_posix_acl, which includes proper permission checks, instead of
    calling ->set_acl directly.  Without this anyone may be able to grant
    themselves permissions to a file by setting the ACL.
    
    Lock the inode to make the new checks atomic with respect to set_acl.
    (Also, nfsd was the only caller of set_acl not locking the inode, so I
    suspect this may fix other races.)
    
    This also simplifies the code, and ensures our ACLs are checked by
    posix_acl_valid.
    
    The permission checks and the inode locking were lost with commit
    4ac7249e, which changed nfsd to use the set_acl inode operation directly
    instead of going through xattr handlers.
    Reported-by: default avatarDavid Sinquin <david@sinquin.eu>
    [agreunba@redhat.com: use set_posix_acl]
    Fixes: 4ac7249e
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
    99965378
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
acl.h Loading commit data...
auth.c Loading commit data...
auth.h Loading commit data...
blocklayout.c Loading commit data...
blocklayoutxdr.c Loading commit data...
blocklayoutxdr.h Loading commit data...
cache.h Loading commit data...
current_stateid.h Loading commit data...
export.c Loading commit data...
export.h Loading commit data...
fault_inject.c Loading commit data...
idmap.h Loading commit data...
lockd.c Loading commit data...
netns.h Loading commit data...
nfs2acl.c Loading commit data...
nfs3acl.c Loading commit data...
nfs3proc.c Loading commit data...
nfs3xdr.c Loading commit data...
nfs4acl.c Loading commit data...
nfs4callback.c Loading commit data...
nfs4idmap.c Loading commit data...
nfs4layouts.c Loading commit data...
nfs4proc.c Loading commit data...
nfs4recover.c Loading commit data...
nfs4state.c Loading commit data...
nfs4xdr.c Loading commit data...
nfscache.c Loading commit data...
nfsctl.c Loading commit data...
nfsd.h Loading commit data...
nfsfh.c Loading commit data...
nfsfh.h Loading commit data...
nfsproc.c Loading commit data...
nfssvc.c Loading commit data...
nfsxdr.c Loading commit data...
pnfs.h Loading commit data...
state.h Loading commit data...
stats.c Loading commit data...
stats.h Loading commit data...
trace.c Loading commit data...
trace.h Loading commit data...
vfs.c Loading commit data...
vfs.h Loading commit data...
xdr.h Loading commit data...
xdr3.h Loading commit data...
xdr4.h Loading commit data...
xdr4cb.h Loading commit data...