linux/fs/afs
Jia-Ju Bai a6eed4ab5d fs: afs: Fix a possible null-pointer dereference in afs_put_read()
In afs_read_dir(), there is an if statement on line 255 to check whether
req->pages is NULL:
	if (!req->pages)
		goto error;

If req->pages is NULL, afs_put_read() on line 337 is executed.
In afs_put_read(), req->pages[i] is used on line 195.
Thus, a possible null-pointer dereference may occur in this case.

To fix this possible bug, an if statement is added in afs_put_read() to
check req->pages.

This bug is found by a static analysis tool STCheck written by us.

Fixes: f3ddee8dc4 ("afs: Fix directory handling")
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
2019-07-30 14:38:51 +01:00
..
addr_list.c Keyrings namespacing 2019-07-08 19:36:47 -07:00
afs_cm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
afs_fs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
afs_vl.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
afs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
cache.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
callback.c afs: Trace afs_server usage 2019-06-20 18:12:17 +01:00
cell.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
cmservice.c afs: Fix the CB.ProbeUuid service handler to reply correctly 2019-07-30 14:38:51 +01:00
dir_edit.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
dir_silly.c fsnotify: move fsnotify_nameremove() hook out of d_delete() 2019-06-20 14:47:44 +02:00
dir.c AFS development 2019-07-10 20:55:33 -07:00
dynroot.c Keyrings namespacing 2019-07-08 19:36:47 -07:00
file.c fs: afs: Fix a possible null-pointer dereference in afs_put_read() 2019-07-30 14:38:51 +01:00
flock.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fs_probe.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
fsclient.c afs: fsclient: Mark expected switch fall-throughs 2019-07-25 20:09:49 -05:00
inode.c afs: Add some callback management tracepoints 2019-06-20 18:12:16 +01:00
internal.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-07-11 10:55:49 -07:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
main.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
Makefile afs: do not send list of client addresses 2019-06-02 18:06:26 -07:00
misc.c AFS development 2019-07-10 20:55:33 -07:00
mntpt.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
proc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
protocol_uae.h afs: Add support for the UAE error table 2019-06-28 18:37:53 +01:00
protocol_yfs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
rotate.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
rxrpc.c AFS development 2019-07-10 20:55:33 -07:00
security.c Revert "Merge tag 'keys-acl-20190703' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs" 2019-07-10 18:43:43 -07:00
server_list.c AFS development 2019-07-10 20:55:33 -07:00
server.c AFS development 2019-07-10 20:55:33 -07:00
super.c afs: Pass pre-fetch server and volume break counts into afs_iget5_set() 2019-05-16 22:23:21 +01:00
vl_list.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
vl_probe.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
vl_rotate.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
vlclient.c afs: Fix loop index mixup in afs_deliver_vl_get_entry_by_name_u() 2019-07-30 14:38:51 +01:00
volume.c AFS fixes 2019-06-28 08:34:12 +08:00
write.c AFS development 2019-07-10 20:55:33 -07:00
xattr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
xdr_fs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
yfsclient.c afs: yfsclient: Mark expected switch fall-throughs 2019-07-25 20:09:46 -05:00