David Howells
29f0698532
afs: Fix AFS read bug
Fix a bug in AFS read whereby the request page afs_read::index isn't
incremented after calling ->page_done() if ->remain reaches 0, indicating
that the data read is complete.
Without this a NULL pointer exception happens when ->page_done() is called
twice for the last page because the page clearing loop will call it also
and afs_readpages_page_done() clears the current entry in the page list.
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: afs_readpages_page_done+0x21/0xa4 [kafs]
PGD 0
Oops: 0002 [#1] SMP
Modules linked in: kafs(E)
CPU: 2 PID: 3002 Comm: md5sum Tainted: G E 4.10.0-fscache #485
Hardware name: ASUS All Series/H97-PLUS, BIOS 2306 10/09/2014
task: ffff8804017d86c0 task.stack: ffff8803fc1d8000
RIP: 0010:afs_readpages_page_done+0x21/0xa4 [kafs]
RSP: 0018:ffff8803fc1db978 EFLAGS: 00010282
RAX: ffff880405d39af8 RBX: 0000000000000000 RCX: ffff880407d83ed4
RDX: 0000000000000000 RSI: ffff880405d39a00 RDI: ffff880405c6f400
RBP: ffff8803fc1db988 R08: 0000000000000000 R09: 0000000000000001
R10: ffff8803fc1db820 R11: ffff88040cf56000 R12: ffff8804088f1780
R13: ffff8804017d86c0 R14: ffff8804088f1780 R15: 0000000000003840
FS: 00007f8154469700(0000) GS:ffff88041fb00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000004016ec000 CR4: 00000000001406e0
Call Trace:
afs_deliver_fs_fetch_data+0x5b9/0x60e [kafs]
? afs_make_call+0x316/0x4e8 [kafs]
? afs_make_call+0x359/0x4e8 [kafs]
afs_deliver_to_call+0x173/0x2e8 [kafs]
? afs_make_call+0x316/0x4e8 [kafs]
afs_make_call+0x37a/0x4e8 [kafs]
? wake_up_q+0x4f/0x4f
? __init_waitqueue_head+0x36/0x49
afs_fs_fetch_data+0x21c/0x227 [kafs]
? afs_fs_fetch_data+0x21c/0x227 [kafs]
afs_vnode_fetch_data+0xf3/0x1d2 [kafs]
afs_readpages+0x314/0x3fd [kafs]
__do_page_cache_readahead+0x208/0x2c5
ondemand_readahead+0x3a2/0x3b7
? ondemand_readahead+0x3a2/0x3b7
page_cache_async_readahead+0x5e/0x67
generic_file_read_iter+0x23b/0x70c
? __inode_security_revalidate+0x2f/0x62
__vfs_read+0xc4/0xe8
vfs_read+0xd1/0x15a
SyS_read+0x4c/0x89
do_syscall_64+0x80/0x191
entry_SYSCALL64_slow_path+0x25/0x25
Reported-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Marc Dionne <marc.dionne@auristor.com>
2017-03-16 16:27:46 +00:00
..
2017-03-03 21:44:35 -08:00
2016-10-10 20:16:43 -07:00
2017-03-02 08:42:31 +01:00
2017-03-16 16:27:46 +00:00
2017-03-02 08:42:31 +01:00
2017-03-02 08:42:31 +01:00
2016-12-24 11:46:01 -08:00
2017-03-03 11:38:56 -08:00
2017-03-02 08:42:31 +01:00
2017-03-03 11:38:56 -08:00
2017-03-03 16:00:59 -08:00
2017-03-03 11:38:56 -08:00
2016-12-24 11:46:01 -08:00
2017-03-02 10:09:00 +11:00
2017-02-23 20:33:51 -08:00
2016-10-10 20:16:43 -07:00
2017-03-09 18:23:27 -08:00
2017-03-03 11:38:56 -08:00
2016-10-10 20:16:43 -07:00
2016-12-24 11:46:01 -08:00
2017-01-14 11:37:18 +01:00
2017-03-03 11:38:56 -08:00
2017-03-02 08:42:31 +01:00
2017-03-03 11:38:56 -08:00
2017-03-03 11:38:56 -08:00
2017-03-09 17:01:10 -08:00
2017-03-02 10:09:00 +11:00
2017-03-03 12:14:13 -08:00
2017-03-15 10:06:07 -04:00
2017-03-03 21:44:35 -08:00
2017-03-02 08:42:31 +01:00
2016-12-09 16:45:04 +01:00
2017-03-02 08:42:32 +01:00
2017-03-02 08:42:32 +01:00
2017-03-02 08:42:31 +01:00
2017-02-20 18:24:39 -08:00
2017-03-02 08:42:32 +01:00
2017-02-27 18:43:46 -08:00
2017-03-03 11:38:56 -08:00
2017-03-02 08:42:29 +01:00
2017-03-02 20:51:15 -05:00
2017-03-03 10:16:38 -08:00
2017-03-03 11:38:56 -08:00
2016-11-18 10:59:15 -05:00
2017-03-03 11:38:56 -08:00
2017-03-02 08:42:32 +01:00
2017-03-02 08:42:32 +01:00
2017-03-02 08:42:32 +01:00
2017-03-09 18:23:27 -08:00
2017-03-02 08:42:31 +01:00
2016-12-24 11:46:01 -08:00
2017-03-03 11:38:56 -08:00
2017-03-08 10:42:13 -08:00
2017-03-03 11:38:56 -08:00
2017-02-24 17:46:57 -08:00
2017-03-02 08:42:31 +01:00
2016-12-24 11:46:01 -08:00
2017-02-27 18:43:46 -08:00
2017-01-24 16:26:14 -08:00
2017-02-24 17:46:57 -08:00
2016-10-14 12:18:50 -07:00
2017-03-02 20:51:15 -05:00
2016-09-27 21:06:21 -04:00
2017-03-02 20:51:15 -05:00
2017-03-02 20:51:15 -05:00
2016-12-24 11:46:01 -08:00
2017-03-08 10:38:53 -08:00
2017-03-03 10:16:38 -08:00
2016-12-24 11:46:01 -08:00
2017-03-02 08:42:29 +01:00
2017-03-02 20:51:15 -05:00
2017-03-02 08:42:36 +01:00
2017-03-02 08:42:39 +01:00
2017-03-02 08:42:39 +01:00
2016-08-02 19:35:15 -04:00
2017-03-02 08:42:36 +01:00
2017-03-02 08:42:37 +01:00
2017-03-02 08:56:59 -07:00
2017-03-02 08:42:37 +01:00
2016-08-23 22:58:51 -07:00
2017-02-01 09:13:51 +01:00
2016-12-24 11:46:01 -08:00
2017-03-02 08:42:31 +01:00
2017-03-02 08:42:36 +01:00
2017-03-02 08:42:37 +01:00
2017-01-10 13:34:43 +13:00
2016-12-24 11:46:01 -08:00
2017-02-27 18:43:46 -08:00
2017-03-02 08:42:32 +01:00
2017-03-02 08:42:32 +01:00
2017-03-02 08:42:35 +01:00
2017-03-02 08:42:35 +01:00
2016-12-24 11:46:01 -08:00
2017-03-02 08:42:31 +01:00
2017-03-02 08:42:29 +01:00
2016-12-24 11:46:01 -08:00
2017-03-02 08:42:35 +01:00
2017-03-13 08:27:34 -06:00
2016-10-10 20:16:43 -07:00
2017-01-30 16:32:25 -08:00
2017-03-02 08:42:37 +01:00
2017-03-06 09:50:01 -08:00
2017-01-24 16:26:14 -08:00
2016-10-24 08:12:35 -02:00
2017-03-03 11:38:56 -08:00
2016-12-24 11:46:01 -08:00
2016-12-14 23:48:11 -05:00
2016-12-03 15:55:01 -05:00
2017-02-04 00:01:06 +13:00
2017-02-27 18:43:46 -08:00
2017-03-02 06:41:22 -05:00
2017-03-02 08:42:38 +01:00
2017-02-03 14:35:43 +13:00
2017-02-07 15:05:04 +01:00
2016-12-24 11:46:01 -08:00
2017-02-04 00:01:06 +13:00
2017-02-04 00:01:06 +13:00
2017-03-02 08:42:31 +01:00
2017-03-02 08:42:38 +01:00
2017-03-03 10:16:38 -08:00
2016-12-24 11:46:01 -08:00
2017-03-02 08:42:29 +01:00
2016-12-24 11:46:01 -08:00
2017-03-03 10:16:38 -08:00
2017-03-03 11:38:56 -08:00
2016-12-05 19:03:49 -05:00
2017-02-23 20:33:51 -08:00
2017-02-20 16:51:23 +01:00
2017-03-01 12:53:44 +01:00
2017-03-10 08:59:07 -08:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00