KASAN: null-ptr-deref Write in vhci_shutdown_connection

6 views
Skip to first unread message

syzbot

unread,
Dec 16, 2020, 6:17:10 PM12/16/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 13d2ce42 Linux 4.19.163
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=170f7137500000
kernel config: https://syzkaller.appspot.com/x/.config?x=fac7c3360835a4e0
dashboard link: https://syzkaller.appspot.com/bug?extid=f1fa2e262f6a74a8ba44
compiler: gcc (GCC) 10.1.0-syz 20200507

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f1fa2e...@syzkaller.appspotmail.com

vhci_hcd: disconnect device
vhci_hcd vhci_hcd.0: pdev(1) rhport(1) sockfd(5)
vhci_hcd vhci_hcd.0: devid(0) speed(2) speed_str(full-speed)
vhci_hcd: connection closed
==================================================================
BUG: KASAN: null-ptr-deref in atomic_inc include/asm-generic/atomic-instrumented.h:109 [inline]
BUG: KASAN: null-ptr-deref in kthread_stop+0x72/0x6b0 kernel/kthread.c:558
Write of size 4 at addr 000000000000001c by task kworker/u4:4/3567

CPU: 1 PID: 3567 Comm: kworker/u4:4 Not tainted 4.19.163-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: usbip_event event_handler
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2fe lib/dump_stack.c:118
kasan_report_error.cold+0x15b/0x1c7 mm/kasan/report.c:352
kasan_report+0x8f/0x96 mm/kasan/report.c:412
atomic_inc include/asm-generic/atomic-instrumented.h:109 [inline]
kthread_stop+0x72/0x6b0 kernel/kthread.c:558
vhci_shutdown_connection+0x14e/0x280 drivers/usb/usbip/vhci_hcd.c:1021
event_handler+0x1f0/0x4f0 drivers/usb/usbip/usbip_event.c:78
process_one_work+0x864/0x1570 kernel/workqueue.c:2155
worker_thread+0x64c/0x1130 kernel/workqueue.c:2298
kthread+0x33f/0x460 kernel/kthread.c:259
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
==================================================================
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 3567 Comm: kworker/u4:4 Tainted: G B 4.19.163-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: usbip_event event_handler
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2fe lib/dump_stack.c:118
panic+0x26a/0x50e kernel/panic.c:186
kasan_end_report+0x43/0x49 mm/kasan/report.c:180
kasan_report_error.cold+0xa7/0x1c7 mm/kasan/report.c:359
kasan_report+0x8f/0x96 mm/kasan/report.c:412
vhci_hcd: vhci_device speed not set
atomic_inc include/asm-generic/atomic-instrumented.h:109 [inline]
kthread_stop+0x72/0x6b0 kernel/kthread.c:558
vhci_shutdown_connection+0x14e/0x280 drivers/usb/usbip/vhci_hcd.c:1021
event_handler+0x1f0/0x4f0 drivers/usb/usbip/usbip_event.c:78
process_one_work+0x864/0x1570 kernel/workqueue.c:2155
worker_thread+0x64c/0x1130 kernel/workqueue.c:2298
kthread+0x33f/0x460 kernel/kthread.c:259
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Dec 17, 2020, 4:11:11 AM12/17/20
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 13d2ce42 Linux 4.19.163
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1611fccb500000
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14460613500000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f1fa2e...@syzkaller.appspotmail.com

vhci_hcd vhci_hcd.0: pdev(5) rhport(0) sockfd(3)
vhci_hcd vhci_hcd.0: devid(0) speed(5) speed_str(super-speed)
vhci_hcd: connection closed
==================================================================
vhci_hcd vhci_hcd.0: pdev(3) rhport(0) sockfd(3)
BUG: KASAN: null-ptr-deref in atomic_inc include/asm-generic/atomic-instrumented.h:109 [inline]
BUG: KASAN: null-ptr-deref in kthread_stop+0x72/0x6b0 kernel/kthread.c:558
vhci_hcd vhci_hcd.0: devid(0) speed(5) speed_str(super-speed)
Write of size 4 at addr 000000000000001c by task kworker/u4:2/62
vhci_hcd: connection closed

vhci_hcd vhci_hcd.0: pdev(1) rhport(0) sockfd(3)
CPU: 0 PID: 62 Comm: kworker/u4:2 Not tainted 4.19.163-syzkaller #0
vhci_hcd vhci_hcd.0: devid(0) speed(5) speed_str(super-speed)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: usbip_event event_handler
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2fe lib/dump_stack.c:118
kasan_report_error.cold+0x15b/0x1c7 mm/kasan/report.c:352
kasan_report+0x8f/0x96 mm/kasan/report.c:412
atomic_inc include/asm-generic/atomic-instrumented.h:109 [inline]
kthread_stop+0x72/0x6b0 kernel/kthread.c:558
vhci_shutdown_connection+0x14e/0x280 drivers/usb/usbip/vhci_hcd.c:1021
event_handler+0x1f0/0x4f0 drivers/usb/usbip/usbip_event.c:78
process_one_work+0x864/0x1570 kernel/workqueue.c:2155
worker_thread+0x64c/0x1130 kernel/workqueue.c:2298
kthread+0x33f/0x460 kernel/kthread.c:259
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
==================================================================
vhci_hcd vhci_hcd.0: pdev(2) rhport(1) sockfd(3)
vhci_hcd vhci_hcd.0: pdev(4) rhport(1) sockfd(3)
vhci_hcd vhci_hcd.0: devid(0) speed(5) speed_str(super-speed)
vhci_hcd vhci_hcd.0: devid(0) speed(5) speed_str(super-speed)
vhci_hcd: connection closed

syzbot

unread,
Jul 15, 2021, 10:38:14 PM7/15/21
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit d42c3ebb315618ca536ef764e3f929ce1d5c3485
Author: Tetsuo Handa <penguin...@i-love.sakura.ne.jp>
Date: Sat Jun 5 10:26:35 2021 +0000

can: bcm/raw/isotp: use per module netdevice notifier

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=14b863d2300000
start commit: 255b58a2b3af Linux 4.19.176
git tree: linux-4.19.y
kernel config: https://syzkaller.appspot.com/x/.config?x=b270830ae46c1d6f
dashboard link: https://syzkaller.appspot.com/bug?extid=f1fa2e262f6a74a8ba44
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=154cc832d00000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: can: bcm/raw/isotp: use per module netdevice notifier

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages