Revision 4beb17e553b49c3dd74505c9f361e756aaae653e authored by Qinglang Miao on 05 January 2021, 05:57:54 UTC, committed by David S. Miller on 06 January 2021, 00:50:09 UTC
A null-ptr-deref bug is reported by Hulk Robot like this: -------------- KASAN: null-ptr-deref in range [0x0000000000000128-0x000000000000012f] Call Trace: qrtr_ns_remove+0x22/0x40 [ns] qrtr_proto_fini+0xa/0x31 [qrtr] __x64_sys_delete_module+0x337/0x4e0 do_syscall_64+0x34/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x468ded -------------- When qrtr_ns_init fails in qrtr_proto_init, qrtr_ns_remove which would be called later on would raise a null-ptr-deref because qrtr_ns.workqueue has been destroyed. Fix it by making qrtr_ns_init have a return value and adding a check in qrtr_proto_init. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 7a68d72
File | Mode | Size |
---|---|---|
include | ||
.gitignore | -rw-r--r-- | 94 bytes |
Kconfig | -rw-r--r-- | 7.7 KB |
Makefile | -rw-r--r-- | 2.9 KB |
default_cpio_list | -rw-r--r-- | 153 bytes |
gen_init_cpio.c | -rw-r--r-- | 12.8 KB |
gen_initramfs.sh | -rwxr-xr-x | 5.7 KB |
initramfs_data.S | -rw-r--r-- | 1.2 KB |
Computing file changes ...