YueHaibing
078b5592a3
packet: Fix error path in packet_init
...
[ Upstream commit 36096f2f4fa05f7678bc87397665491700bae757 ]
kernel BUG at lib/list_debug.c:47!
invalid opcode: 0000 [#1
CPU: 0 PID: 12914 Comm: rmmod Tainted: G W 5.1.0+ #47
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_del_entry_valid+0x53/0x90
Code: 48 8b 32 48 39 fe 75 35 48 8b 50 08 48 39 f2 75 40 b8 01 00 00 00 5d c3 48
89 fe 48 89 c2 48 c7 c7 18 75 fe 82 e8 cb 34 78 ff <0f> 0b 48 89 fe 48 c7 c7 50 75 fe 82 e8 ba 34 78 ff 0f 0b 48 89 f2
RSP: 0018:ffffc90001c2fe40 EFLAGS: 00010286
RAX: 000000000000004e RBX: ffffffffa0184000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff888237a17788 RDI: 00000000ffffffff
RBP: ffffc90001c2fe40 R08: 0000000000000000 R09: 0000000000000000
R10: ffffc90001c2fe10 R11: 0000000000000000 R12: 0000000000000000
R13: ffffc90001c2fe50 R14: ffffffffa0184000 R15: 0000000000000000
FS: 00007f3d83634540(0000) GS:ffff888237a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555c350ea818 CR3: 0000000231677000 CR4: 00000000000006f0
Call Trace:
unregister_pernet_operations+0x34/0x120
unregister_pernet_subsys+0x1c/0x30
packet_exit+0x1c/0x369 [af_packet
__x64_sys_delete_module+0x156/0x260
? lockdep_hardirqs_on+0x133/0x1b0
? do_syscall_64+0x12/0x1f0
do_syscall_64+0x6e/0x1f0
entry_SYSCALL_64_after_hwframe+0x49/0xbe
When modprobe af_packet, register_pernet_subsys
fails and does a cleanup, ops->list is set to LIST_POISON1,
but the module init is considered to success, then while rmmod it,
BUG() is triggered in __list_del_entry_valid which is called from
unregister_pernet_subsys. This patch fix error handing path in
packet_init to avoid possilbe issue if some error occur.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-16 19:42:34 +02:00
..
2018-10-03 17:00:47 -07:00
2019-04-20 09:15:04 +02:00
2017-11-02 11:10:55 +01:00
2018-07-22 14:28:44 +02:00
2019-04-20 09:15:07 +02:00
2019-04-27 09:35:33 +02:00
2019-02-23 09:06:44 +01:00
2019-05-08 07:20:47 +02:00
2019-05-10 17:53:15 +02:00
2019-05-16 19:42:33 +02:00
2019-05-08 07:20:45 +02:00
2019-01-31 08:13:46 +01:00
2019-03-27 14:13:51 +09:00
2019-05-16 19:42:33 +02:00
2018-09-19 22:43:43 +02:00
2019-04-03 06:25:08 +02:00
2018-02-25 11:07:52 +01:00
2018-07-22 14:28:49 +02:00
2019-05-16 19:42:34 +02:00
2019-03-19 13:13:22 +01:00
2019-04-27 09:35:40 +02:00
2018-04-29 11:33:13 +02:00
2019-05-16 19:42:34 +02:00
2019-05-08 07:20:44 +02:00
2017-11-02 11:10:55 +01:00
2018-03-31 18:10:41 +02:00
2019-04-17 08:37:45 +02:00
2019-03-23 14:35:14 +01:00
2019-03-19 13:13:22 +01:00
2018-12-01 09:42:51 +01:00
2019-05-16 19:42:21 +02:00
2018-09-09 19:55:52 +02:00
2019-03-13 14:03:09 -07:00
2017-10-21 01:56:38 +01:00
2019-05-16 19:42:30 +02:00
2019-03-13 14:03:08 -07:00
2019-04-03 06:25:08 +02:00
2019-02-06 17:31:32 +01:00
2019-05-16 19:42:32 +02:00
2018-07-22 14:28:49 +02:00
2019-04-27 09:35:40 +02:00
2019-05-16 19:42:34 +02:00
2019-03-23 14:35:16 +01:00
2017-11-01 12:19:03 +09:00
2018-08-24 13:09:13 +02:00
2019-05-02 09:40:33 +02:00
2018-05-16 10:10:26 +02:00
2019-05-02 09:40:34 +02:00
2019-05-08 07:20:44 +02:00
2019-05-16 19:42:30 +02:00
2019-05-08 07:20:44 +02:00
2019-01-09 17:14:46 +01:00
2018-07-22 14:28:47 +02:00
2019-05-02 09:40:29 +02:00
2017-08-07 14:48:48 -07:00
2019-05-02 09:40:32 +02:00
2018-12-05 19:41:11 +01:00
2019-03-19 13:13:24 +01:00
2019-05-02 09:40:31 +02:00
2017-11-02 11:10:55 +01:00
2019-05-16 19:42:21 +02:00
2019-03-19 13:13:23 +01:00
2019-02-15 08:09:13 +01:00
2019-01-09 17:14:46 +01:00
2017-09-04 13:25:20 +02:00
2017-11-02 11:10:55 +01:00
2019-03-13 14:03:09 -07:00