Ben Hutchings 999653786d nfsd: check permissions when setting ACLs
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>
2016-06-24 12:11:52 -04:00
..
2014-07-08 17:14:27 -04:00
2016-03-18 11:42:53 -04:00
2014-08-17 12:00:12 -04:00
2016-03-18 11:42:53 -04:00
2016-03-18 11:42:53 -04:00
2015-04-21 16:16:02 -04:00
2016-01-22 18:04:28 -05:00
2016-03-18 11:42:53 -04:00
2016-06-15 22:03:31 -04:00
2016-01-14 17:32:51 -05:00
2016-05-01 19:58:39 -04:00
2015-02-02 18:09:43 +01:00