diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2016-06-22 19:43:35 +0100 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2016-08-22 12:23:31 -0400 |
commit | 3e287c23efba166b0b4c618a4f7e52016ff0e0ae (patch) | |
tree | cdbd6d5d2bc560e1ccffa49f48a57bc41c1fd2fb /include/trace | |
parent | 6abbd53f83fe94fb2562b3a45ef7770e4dfcde29 (diff) | |
download | linux-stable-3e287c23efba166b0b4c618a4f7e52016ff0e0ae.tar.gz linux-stable-3e287c23efba166b0b4c618a4f7e52016ff0e0ae.tar.bz2 linux-stable-3e287c23efba166b0b4c618a4f7e52016ff0e0ae.zip |
nfsd: check permissions when setting ACLs
[ Upstream commit 999653786df6954a31044528ac3f7a5dadca08f4 ]
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: David 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: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'include/trace')
0 files changed, 0 insertions, 0 deletions