syzbot


KASAN: use-after-free Read in vhci_tx_loop

Status: upstream: reported on 2025/03/31 17:53
Reported-by: syzbot+d3522efdacb894c28124@syzkaller.appspotmail.com
First crash: 21d, last: 21d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in vhci_tx_loop usb 1 114d 110d 0/28 auto-obsoleted due to no activity on 2025/03/28 12:39

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in vhci_send_cmd_submit drivers/usb/usbip/vhci_tx.c:69 [inline]
BUG: KASAN: use-after-free in vhci_tx_loop+0x354/0x1730 drivers/usb/usbip/vhci_tx.c:241
Read of size 8 at addr ffff0000d911e620 by task vhci_tx/5683

CPU: 0 PID: 5683 Comm: vhci_tx Not tainted 5.15.179-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x174/0x1e4 mm/kasan/report.c:451
 __asan_report_load8_noabort+0x44/0x50 mm/kasan/report_generic.c:309
 vhci_send_cmd_submit drivers/usb/usbip/vhci_tx.c:69 [inline]
 vhci_tx_loop+0x354/0x1730 drivers/usb/usbip/vhci_tx.c:241
 kthread+0x37c/0x45c kernel/kthread.c:334
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870

Allocated by task 25:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc+0xbc/0xfc mm/kasan/common.c:513
 __kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 kmem_cache_alloc_trace+0x27c/0x47c mm/slub.c:3247
 kmalloc include/linux/slab.h:591 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 vhci_tx_urb drivers/usb/usbip/vhci_hcd.c:670 [inline]
 vhci_urb_enqueue+0x51c/0xcb8 drivers/usb/usbip/vhci_hcd.c:803
 usb_hcd_submit_urb+0x334/0x1b18 drivers/usb/core/hcd.c:1559
 usb_submit_urb+0xe94/0x1588 drivers/usb/core/urb.c:594
 usb_start_wait_urb+0xec/0x414 drivers/usb/core/message.c:58
 usb_internal_control_msg drivers/usb/core/message.c:102 [inline]
 usb_control_msg+0x228/0x3f8 drivers/usb/core/message.c:153
 get_bMaxPacketSize0 drivers/usb/core/hub.c:4750 [inline]
 hub_port_init+0x96c/0x21cc drivers/usb/core/hub.c:4947
 hub_port_connect drivers/usb/core/hub.c:5396 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5607 [inline]
 port_event drivers/usb/core/hub.c:5753 [inline]
 hub_event+0x203c/0x46b8 drivers/usb/core/hub.c:5835
 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310
 worker_thread+0x910/0x1034 kernel/workqueue.c:2457
 kthread+0x37c/0x45c kernel/kthread.c:334
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870

Freed by task 5682:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4c/0x84 mm/kasan/common.c:46
 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360
 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366
 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kfree+0x178/0x410 mm/slub.c:4559
 pickup_urb_and_free_priv+0x228/0x370 drivers/usb/usbip/vhci_rx.c:46
 vhci_recv_ret_submit drivers/usb/usbip/vhci_rx.c:65 [inline]
 vhci_rx_pdu drivers/usb/usbip/vhci_rx.c:242 [inline]
 vhci_rx_loop+0x334/0xd94 drivers/usb/usbip/vhci_rx.c:265
 kthread+0x37c/0x45c kernel/kthread.c:334
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870

The buggy address belongs to the object at ffff0000d911e600
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 32 bytes inside of
 128-byte region [ffff0000d911e600, ffff0000d911e680)
The buggy address belongs to the page:
page:00000000f180b1db refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11911e
flags: 0x5ffc00000000200(slab|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000200 0000000000000000 dead000000000122 ffff0000c0002300
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000d911e500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff0000d911e580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000d911e600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                               ^
 ffff0000d911e680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000d911e700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Unable to handle kernel paging request at virtual address fb87806900000006
Mem abort info:
  ESR = 0x0000000096000004
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
  FSC = 0x04: level 0 translation fault
Data abort info:
  ISV = 0, ISS = 0x00000004
  CM = 0, WnR = 0
[fb87806900000006] address between user and kernel address ranges
Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 5683 Comm: vhci_tx Tainted: G    B             5.15.179-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
pstate: 00400005 (nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : setup_cmd_submit_pdu drivers/usb/usbip/vhci_tx.c:16 [inline]
pc : vhci_send_cmd_submit drivers/usb/usbip/vhci_tx.c:95 [inline]
pc : vhci_tx_loop+0x4a8/0x1730 drivers/usb/usbip/vhci_tx.c:241
lr : setup_cmd_submit_pdu drivers/usb/usbip/vhci_tx.c:15 [inline]
lr : vhci_send_cmd_submit drivers/usb/usbip/vhci_tx.c:95 [inline]
lr : vhci_tx_loop+0x49c/0x1730 drivers/usb/usbip/vhci_tx.c:241
sp : ffff8000206c7a00
x29: ffff8000206c7df0 x28: ffff0000e6489d00 x27: ffff0000cf26c590
x26: ffff8000206c7cf0 x25: ffff0000d166fa7c x24: ffff8000206c7c70
x23: dc40034800000031 x22: dfff800000000000 x21: dc40034800000019
x20: ffff0000d166fa00 x19: 0000000000000003 x18: 1fffe0003682e78e
x17: 1fffe0003682e78e x16: ffff80000824f3a0 x15: ffff800014c0f2a0
x14: 00000000ffff8000 x13: ffff80000802b56c x12: 0000000000000001
x11: 0000000000000000 x10: 0000000000000000 x9 : ffff80001b849390
x8 : 1b88006900000006 x7 : 0000000000000000 x6 : ffff8000088d550c
x5 : ffff0000f221dc88 x4 : 0000000000000000 x3 : ffff80000df35ae4
x2 : 0000000000000000 x1 : 0000000000000008 x0 : 0000000000000000
Call trace:
 setup_cmd_submit_pdu drivers/usb/usbip/vhci_tx.c:16 [inline]
 vhci_send_cmd_submit drivers/usb/usbip/vhci_tx.c:95 [inline]
 vhci_tx_loop+0x4a8/0x1730 drivers/usb/usbip/vhci_tx.c:241
 kthread+0x37c/0x45c kernel/kthread.c:334
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870
Code: 96a6889a f94002b5 910062b7 d343fee8 (38766908) 
---[ end trace b4f54a6be561741b ]---
----------------
Code disassembly (best guess):
   0:	96a6889a 	bl	0xfffffffffa9a2268
   4:	f94002b5 	ldr	x21, [x21]
   8:	910062b7 	add	x23, x21, #0x18
   c:	d343fee8 	lsr	x8, x23, #3
* 10:	38766908 	ldrb	w8, [x8, x22] <-- trapping instruction

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/03/31 17:52 linux-5.15.y 0c935c049b5c d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in vhci_tx_loop
* Struck through repros no longer work on HEAD.