linux/fs/afs
David Howells 378831e4da afs: Fix directory permissions check
Doing faccessat("/afs/some/directory", 0) triggers a BUG in the permissions
check code.

Fix this by just removing the BUG section.  If no permissions are asked
for, just return okay if the file exists.

Also:

 (1) Split up the directory check so that it has separate if-statements
     rather than if-else-if (e.g. checking for MAY_EXEC shouldn't skip the
     check for MAY_READ and MAY_WRITE).

 (2) Check for MAY_CHDIR as MAY_EXEC.

Without the main fix, the following BUG may occur:

 kernel BUG at fs/afs/security.c:386!
 invalid opcode: 0000 [#1] SMP PTI
 ...
 RIP: 0010:afs_permission+0x19d/0x1a0 [kafs]
 ...
 Call Trace:
  ? inode_permission+0xbe/0x180
  ? do_faccessat+0xdc/0x270
  ? do_syscall_64+0x60/0x1f0
  ? entry_SYSCALL_64_after_hwframe+0x49/0xbe

Fixes: 00d3b7a453 ("[AFS]: Add security support.")
Reported-by: Jonathan Billings <jsbillings@jsbillings.org>
Signed-off-by: David Howells <dhowells@redhat.com>
2018-05-16 21:35:23 +01:00
..
addr_list.c afs: Fix address list parsing 2018-05-14 13:17:35 +01:00
afs_cm.h afs: support the CB.ProbeUuid RPC op 2008-04-29 08:06:26 -07:00
afs_fs.h afs: Prospectively look up extra files when doing a single lookup 2018-04-09 21:12:31 +01:00
afs_vl.h afs: Make use of the YFS service upgrade to fully support IPv6 2017-11-13 15:38:19 +00:00
afs.h afs: Rearrange status mapping 2018-04-09 21:53:59 +01:00
cache.c fscache: Pass object size in rather than calling back for it 2018-04-06 14:05:14 +01:00
callback.c afs: Fix whole-volume callback handling 2018-05-14 15:15:18 +01:00
cell.c afs: Implement @cell substitution handling 2018-04-09 21:18:58 +01:00
cmservice.c afs: Fix CB.CallBack handling 2018-05-14 15:15:19 +01:00
dir_edit.c afs: Locally edit directory data for mkdir/create/unlink/... 2018-04-09 21:54:48 +01:00
dir.c afs: Fix whole-volume callback handling 2018-05-14 15:15:18 +01:00
dynroot.c afs: Split the dynroot stuff out and give it its own ops tables 2018-04-09 21:54:00 +01:00
file.c afs: Fix whole-volume callback handling 2018-05-14 15:15:18 +01:00
flock.c afs: Fix whole-volume callback handling 2018-05-14 15:15:18 +01:00
fsclient.c afs: Fix whole-volume callback handling 2018-05-14 15:15:18 +01:00
inode.c afs: Fix whole-volume callback handling 2018-05-14 15:15:18 +01:00
internal.h afs: Fix whole-volume callback handling 2018-05-14 15:15:18 +01:00
Kconfig fs/afs: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:39:04 -08:00
main.c afs: Implement @sys substitution handling 2018-04-09 21:12:31 +01:00
Makefile afs: Locally edit directory data for mkdir/create/unlink/... 2018-04-09 21:54:48 +01:00
misc.c afs: Consolidate abort_to_error translators 2017-11-13 15:38:17 +00:00
mntpt.c afs: Support the AFS dynamic root 2018-02-06 14:43:37 +00:00
netdevices.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
proc.c afs: Add stats for data transfer operations 2018-04-09 21:54:48 +01:00
rotate.c afs: Fix VNOVOL handling in address rotation 2018-05-14 15:15:18 +01:00
rxrpc.c afs: Fix the non-encryption of calls 2018-05-14 15:15:19 +01:00
security.c afs: Fix directory permissions check 2018-05-16 21:35:23 +01:00
server_list.c afs: Fix refcounting in callback registration 2018-05-14 13:17:35 +01:00
server.c afs: Fix afs_find_server search loop 2018-05-14 15:15:18 +01:00
super.c afs: Fix whole-volume callback handling 2018-05-14 15:15:18 +01:00
vlclient.c afs: Trace protocol errors 2018-04-09 21:54:48 +01:00
volume.c fscache: Pass object size in rather than calling back for it 2018-04-06 14:05:14 +01:00
write.c afs: Fix whole-volume callback handling 2018-05-14 15:15:18 +01:00
xattr.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
xdr_fs.h afs: Adjust the directory XDR structures 2018-04-09 21:54:48 +01:00