]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
usb: mtu3: fix list_head check warning
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Sat, 18 Dec 2021 09:57:48 +0000 (17:57 +0800)
committerAndrea Righi <andrea.righi@canonical.com>
Fri, 21 Jan 2022 14:49:20 +0000 (15:49 +0100)
commit63132c0c7db59f95d8c6552f8fd1d74e4c9ae9b6
treeb42289228a1461ee33499675c84a77b0b0c1d982
parent89d28a8b33042670498243f3d25103c488bffa35
usb: mtu3: fix list_head check warning

BugLink: https://bugs.launchpad.net/bugs/1956926
commit 8c313e3bfd9adae8d5c4ba1cc696dcbc86fbf9bf upstream.

This is caused by uninitialization of list_head.

BUG: KASAN: use-after-free in __list_del_entry_valid+0x34/0xe4

Call trace:
dump_backtrace+0x0/0x298
show_stack+0x24/0x34
dump_stack+0x130/0x1a8
print_address_description+0x88/0x56c
__kasan_report+0x1b8/0x2a0
kasan_report+0x14/0x20
__asan_load8+0x9c/0xa0
__list_del_entry_valid+0x34/0xe4
mtu3_req_complete+0x4c/0x300 [mtu3]
mtu3_gadget_stop+0x168/0x448 [mtu3]
usb_gadget_unregister_driver+0x204/0x3a0
unregister_gadget_item+0x44/0xa4

Fixes: 83374e035b62 ("usb: mtu3: add tracepoints to help debug")
Cc: stable@vger.kernel.org
Reported-by: Yuwen Ng <yuwen.ng@mediatek.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20211218095749.6250-3-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <p.pisati@gmail.com>
drivers/usb/mtu3/mtu3_gadget.c