YueHaibing
93b3fe8ae9
9p/virtio: Add cleanup path in p9_virtio_init
...
commit d4548543fc4ece56c6f04b8586f435fb4fd84c20 upstream.
KASAN report this:
BUG: unable to handle kernel paging request at ffffffffa0097000
PGD 3870067 P4D 3870067 PUD 3871063 PMD 2326e2067 PTE 0
Oops: 0000 [#1
CPU: 0 PID: 5340 Comm: modprobe Not tainted 5.1.0-rc7+ #25
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
RIP: 0010:__list_add_valid+0x10/0x70
Code: c3 48 8b 06 55 48 89 e5 5d 48 39 07 0f 94 c0 0f b6 c0 c3 90 90 90 90 90 90 90 55 48 89 d0 48 8b 52 08 48 89 e5 48 39 f2 75 19 <48> 8b 32 48 39 f0 75 3a
RSP: 0018:ffffc90000e23c68 EFLAGS: 00010246
RAX: ffffffffa00ad000 RBX: ffffffffa009d000 RCX: 0000000000000000
RDX: ffffffffa0097000 RSI: ffffffffa0097000 RDI: ffffffffa009d000
RBP: ffffc90000e23c68 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffffa0097000
R13: ffff888231797180 R14: 0000000000000000 R15: ffffc90000e23e78
FS: 00007fb215285540(0000) GS:ffff888237a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffa0097000 CR3: 000000022f144000 CR4: 00000000000006f0
Call Trace:
v9fs_register_trans+0x2f/0x60 [9pnet
? 0xffffffffa0087000
p9_virtio_init+0x25/0x1000 [9pnet_virtio
do_one_initcall+0x6c/0x3cc
? kmem_cache_alloc_trace+0x248/0x3b0
do_init_module+0x5b/0x1f1
load_module+0x1db1/0x2690
? m_show+0x1d0/0x1d0
__do_sys_finit_module+0xc5/0xd0
__x64_sys_finit_module+0x15/0x20
do_syscall_64+0x6b/0x1d0
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fb214d8e839
Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01
RSP: 002b:00007ffc96554278 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
RAX: ffffffffffffffda RBX: 000055e67eed2aa0 RCX: 00007fb214d8e839
RDX: 0000000000000000 RSI: 000055e67ce95c2e RDI: 0000000000000003
RBP: 000055e67ce95c2e R08: 0000000000000000 R09: 000055e67eed2aa0
R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
R13: 000055e67eeda500 R14: 0000000000040000 R15: 000055e67eed2aa0
Modules linked in: 9pnet_virtio(+) 9pnet gre rfkill vmw_vsock_virtio_transport_common vsock [last unloaded: 9pnet_virtio
CR2: ffffffffa0097000
---[ end trace 4a52bb13ff07b761
If register_virtio_driver() fails in p9_virtio_init,
we should call v9fs_unregister_trans() to do cleanup.
Link: http://lkml.kernel.org/r/20190430115942.41840-1-yuehaibing@huawei.com
Cc: stable@vger.kernel.org
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: b530cc794024 ("9p: add virtio transport")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-04 09:34:51 +02:00
..
2018-10-10 08:52:04 +02:00
2019-08-04 09:34:51 +02:00
2019-05-16 19:45:17 +02:00
2019-04-27 09:33:59 +02:00
2019-04-27 09:33:59 +02:00
2019-06-22 08:18:25 +02:00
2019-08-04 09:34:39 +02:00
2019-08-04 09:34:49 +02:00
2019-05-16 19:45:17 +02:00
2018-09-05 09:18:34 +02:00
2019-07-10 09:56:33 +02:00
2019-03-23 08:44:18 +01:00
2019-06-22 08:18:25 +02:00
2018-09-19 22:48:58 +02:00
2019-04-03 06:23:25 +02:00
2018-02-25 11:03:38 +01:00
2018-07-22 14:25:54 +02:00
2019-02-20 10:13:15 +01:00
2017-02-18 16:39:27 +01:00
2019-03-23 08:44:31 +01:00
2019-02-08 11:25:32 +01:00
2019-07-10 09:56:37 +02:00
2019-06-22 08:18:25 +02:00
2017-05-25 14:30:13 +02:00
2018-09-15 09:40:40 +02:00
2018-11-10 07:41:35 -08:00
2019-08-04 09:34:42 +02:00
2019-03-23 08:44:29 +01:00
2015-10-07 04:27:43 -07:00
2019-06-22 08:18:25 +02:00
2019-06-11 12:24:06 +02:00
2019-07-21 09:07:06 +02:00
2018-09-09 20:04:32 +02:00
2018-03-11 16:19:47 +01:00
2019-05-16 19:45:06 +02:00
2018-10-20 09:52:36 +02:00
2018-08-09 12:19:28 +02:00
2019-02-06 19:43:06 +01:00
2019-03-23 08:44:22 +01:00
2019-04-27 09:33:54 +02:00
2019-05-16 19:45:17 +02:00
2019-03-23 08:44:34 +01:00
2019-06-11 12:24:12 +02:00
2018-05-16 10:06:51 +02:00
2019-04-03 06:23:25 +02:00
2018-04-13 19:50:23 +02:00
2019-06-11 12:24:10 +02:00
2019-07-10 09:56:36 +02:00
2019-05-16 19:44:44 +02:00
2016-06-24 10:18:16 -07:00
2019-07-10 09:56:37 +02:00
2019-03-23 08:44:31 +01:00
2019-02-23 09:05:13 +01:00
2015-08-09 22:43:52 -07:00
2019-07-10 09:56:34 +02:00
2019-03-23 08:44:30 +01:00
2019-08-04 09:34:46 +02:00
2019-01-13 10:05:28 +01:00
2018-02-25 11:03:37 +01:00
2015-09-29 20:40:32 -07:00
2019-03-23 08:44:21 +01:00
2016-09-15 08:27:50 +02:00