syzbot


KASAN: use-after-free Read in __usb_hcd_giveback_urb

Status: upstream: reported syz repro on 2024/04/06 03:35
Reported-by: syzbot+94936196e16d5ad44ed6@syzkaller.appspotmail.com
First crash: 465d, last: 5d05h
Bug presence (1)
Date Name Commit Repro Result
2025/03/22 upstream (ToT) 183601b78a9b C Didn't crash
Similar bugs (6)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in __usb_hcd_giveback_urb 19 39 23d 612d 0/3 upstream: reported on 2023/11/11 02:11
upstream KASAN: use-after-free Read in __usb_hcd_giveback_urb (2) usb 19 1 956d 952d 0/29 auto-obsoleted due to no activity on 2023/03/31 19:51
upstream KASAN: use-after-free Read in __usb_hcd_giveback_urb usb 19 1 1804d 1803d 0/29 auto-closed as invalid on 2020/12/04 05:52
upstream KASAN: slab-use-after-free Read in __usb_hcd_giveback_urb usb 19 1 695d 694d 0/29 auto-obsoleted due to no activity on 2023/11/28 05:12
upstream KASAN: slab-use-after-free Read in __usb_hcd_giveback_urb (2) usb 24 246 7d15h 480d 0/29 upstream: reported on 2024/03/22 17:26
linux-6.6 KASAN: slab-use-after-free Read in __usb_hcd_giveback_urb 19 2 19h55m 5d08h 0/2 upstream: reported on 2025/07/10 08:57

Sample crash report:
xpad 6-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19
xpad 6-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19
==================================================================
BUG: KASAN: use-after-free in register_lock_class+0x7ce/0x860 kernel/locking/lockdep.c:1331
Read of size 1 at addr ffff888077f6e091 by task ksoftirqd/1/21

CPU: 1 PID: 21 Comm: ksoftirqd/1 Not tainted 6.1.143-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0xa8/0x220 mm/kasan/report.c:427
 kasan_report+0x10b/0x140 mm/kasan/report.c:531
 register_lock_class+0x7ce/0x860 kernel/locking/lockdep.c:1331
 __lock_acquire+0x160/0x7c50 kernel/locking/lockdep.c:4928
 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
 __wake_up_common_lock kernel/sched/wait.c:137 [inline]
 __wake_up+0xf4/0x190 kernel/sched/wait.c:160
 __usb_hcd_giveback_urb+0x396/0x520 drivers/usb/core/hcd.c:1678
 dummy_timer+0x888/0x31b0 drivers/usb/gadget/udc/dummy_hcd.c:1994
 __run_hrtimer kernel/time/hrtimer.c:1752 [inline]
 __hrtimer_run_queues+0x554/0xd60 kernel/time/hrtimer.c:1816
 hrtimer_run_softirq+0x183/0x2a0 kernel/time/hrtimer.c:1833
 handle_softirqs+0x2a1/0x920 kernel/softirq.c:596
 run_ksoftirqd+0x98/0xf0 kernel/softirq.c:963
 smpboot_thread_fn+0x64a/0xa40 kernel/smpboot.c:164
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Allocated by task 15420:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 xpad_probe+0x41d/0x1d30 drivers/input/joystick/xpad.c:1967
 usb_probe_interface+0x5a0/0xaf0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x2aa/0xc70 drivers/base/dd.c:639
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:785
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:815
 __device_attach_driver+0x2c6/0x510 drivers/base/dd.c:943
 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
 __device_attach+0x29b/0x460 drivers/base/dd.c:1015
 bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
 device_add+0xa00/0xfb0 drivers/base/core.c:3697
 usb_set_configuration+0x1991/0x1fd0 drivers/usb/core/message.c:2165
 usb_generic_driver_probe+0x89/0x150 drivers/usb/core/generic.c:238
 usb_probe_device+0x139/0x270 drivers/usb/core/driver.c:293
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x2aa/0xc70 drivers/base/dd.c:639
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:785
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:815
 __device_attach_driver+0x2c6/0x510 drivers/base/dd.c:943
 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
 __device_attach+0x29b/0x460 drivers/base/dd.c:1015
 bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
 device_add+0xa00/0xfb0 drivers/base/core.c:3697
 usb_new_device+0xd4d/0x1620 drivers/usb/core/hub.c:2631
 hub_port_connect drivers/usb/core/hub.c:5489 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5629 [inline]
 port_event drivers/usb/core/hub.c:5785 [inline]
 hub_event+0x2b02/0x5210 drivers/usb/core/hub.c:5867
 process_one_work+0x898/0x1160 kernel/workqueue.c:2292
 worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Freed by task 16075:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516
 ____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1724 [inline]
 slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1750
 slab_free mm/slub.c:3661 [inline]
 __kmem_cache_free+0xb6/0x1f0 mm/slub.c:3674
 xpad_disconnect+0x34c/0x470 drivers/input/joystick/xpad.c:2148
 usb_unbind_interface+0x1ee/0x860 drivers/usb/core/driver.c:458
 device_remove drivers/base/dd.c:550 [inline]
 __device_release_driver drivers/base/dd.c:1260 [inline]
 device_release_driver_internal+0x522/0x850 drivers/base/dd.c:1286
 bus_remove_device+0x2e2/0x400 drivers/base/bus.c:531
 device_del+0x628/0xa70 drivers/base/core.c:3885
 usb_disable_device+0x3e2/0x890 drivers/usb/core/message.c:1414
 usb_disconnect+0x348/0x8a0 drivers/usb/core/hub.c:2286
 hub_port_connect drivers/usb/core/hub.c:5333 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5629 [inline]
 port_event drivers/usb/core/hub.c:5785 [inline]
 hub_event+0x1d20/0x5210 drivers/usb/core/hub.c:5867
 process_one_work+0x898/0x1160 kernel/workqueue.c:2292
 worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
 call_rcu+0x14b/0x970 kernel/rcu/tree.c:2845
 sctp_association_free+0x69d/0x7e0 net/sctp/associola.c:382
 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline]
 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1331 [inline]
 sctp_side_effects net/sctp/sm_sideeffect.c:1199 [inline]
 sctp_do_sm+0x36a4/0x5500 net/sctp/sm_sideeffect.c:1170
 sctp_assoc_bh_rcv+0x3ee/0x630 net/sctp/associola.c:1054
 sctp_backlog_rcv+0x15f/0x3e0 net/sctp/input.c:346
 sk_backlog_rcv include/net/sock.h:1119 [inline]
 __release_sock+0x1b9/0x420 net/core/sock.c:2939
 release_sock+0x5b/0x1b0 net/core/sock.c:3503
 sctp_wait_for_connect+0x37e/0x680 net/sctp/socket.c:9354
 __sctp_connect+0xabb/0xd20 net/sctp/socket.c:1246
 sctp_connect net/sctp/socket.c:4818 [inline]
 sctp_inet_connect+0x12a/0x1d0 net/sctp/socket.c:4833
 __sys_connect_file net/socket.c:2011 [inline]
 __sys_connect+0x389/0x410 net/socket.c:2028
 __do_sys_connect net/socket.c:2038 [inline]
 __se_sys_connect net/socket.c:2035 [inline]
 __x64_sys_connect+0x76/0x80 net/socket.c:2035
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Second to last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
 kvfree_call_rcu+0x108/0x870 kernel/rcu/tree.c:3401
 neigh_del net/core/neighbour.c:225 [inline]
 neigh_remove_one+0x5ed/0x700 net/core/neighbour.c:246
 neigh_forced_gc net/core/neighbour.c:279 [inline]
 neigh_alloc net/core/neighbour.c:485 [inline]
 ___neigh_create+0x46a/0x24c0 net/core/neighbour.c:648
 ip6_finish_output2+0x14f0/0x1590 net/ipv6/ip6_output.c:129
 __ip6_finish_output net/ipv6/ip6_output.c:205 [inline]
 ip6_finish_output+0x5d3/0xa60 net/ipv6/ip6_output.c:216
 dst_output include/net/dst.h:453 [inline]
 NF_HOOK include/linux/netfilter.h:302 [inline]
 ndisc_send_skb+0xbfb/0x1510 net/ipv6/ndisc.c:513
 addrconf_rs_timer+0x2b8/0x600 net/ipv6/addrconf.c:3985
 call_timer_fn+0x1a0/0x670 kernel/time/timer.c:1504
 expire_timers kernel/time/timer.c:1549 [inline]
 __run_timers+0x525/0x7c0 kernel/time/timer.c:1820
 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833
 handle_softirqs+0x2a1/0x920 kernel/softirq.c:596
 run_ksoftirqd+0x98/0xf0 kernel/softirq.c:963
 smpboot_thread_fn+0x64a/0xa40 kernel/smpboot.c:164
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff888077f6e000
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 145 bytes inside of
 1024-byte region [ffff888077f6e000, ffff888077f6e400)

The buggy address belongs to the physical page:
page:ffffea0001dfda00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x77f68
head:ffffea0001dfda00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001531a00 dead000000000002 ffff888017441dc0
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4321, tgid 4321 (kworker/0:4), ts 75357251257, free_ts 75293267034
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
 prep_new_page mm/page_alloc.c:2539 [inline]
 get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614
 alloc_slab_page+0x5d/0x160 mm/slub.c:1794
 allocate_slab mm/slub.c:1939 [inline]
 new_slab+0x87/0x2c0 mm/slub.c:1992
 ___slab_alloc+0xbc6/0x1220 mm/slub.c:3180
 __slab_alloc mm/slub.c:3279 [inline]
 slab_alloc_node mm/slub.c:3364 [inline]
 __kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3437
 __do_kmalloc_node mm/slab_common.c:935 [inline]
 __kmalloc_node_track_caller+0x9e/0x230 mm/slab_common.c:956
 kmalloc_reserve net/core/skbuff.c:446 [inline]
 __alloc_skb+0x22a/0x7e0 net/core/skbuff.c:515
 alloc_skb include/linux/skbuff.h:1271 [inline]
 nlmsg_new include/net/netlink.h:991 [inline]
 inet6_rt_notify+0xb0/0x240 net/ipv6/route.c:6231
 fib6_add_rt2node net/ipv6/ip6_fib.c:1256 [inline]
 fib6_add+0x1d88/0x3cc0 net/ipv6/ip6_fib.c:1485
 __ip6_ins_rt net/ipv6/route.c:1345 [inline]
 ip6_ins_rt+0xc5/0x110 net/ipv6/route.c:1355
 __ipv6_ifa_notify+0x4c1/0xdb0 net/ipv6/addrconf.c:6220
 ipv6_ifa_notify net/ipv6/addrconf.c:6259 [inline]
 addrconf_dad_completed+0x17d/0xcf0 net/ipv6/addrconf.c:4263
 addrconf_dad_work+0xc3e/0x14d0 net/ipv6/addrconf.c:-1
 process_one_work+0x898/0x1160 kernel/workqueue.c:2292
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1459 [inline]
 free_pcp_prepare mm/page_alloc.c:1509 [inline]
 free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384
 free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479
 qlink_free mm/kasan/quarantine.c:168 [inline]
 qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
 kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
 __kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
 slab_alloc_node mm/slub.c:3398 [inline]
 __kmem_cache_alloc_node+0x140/0x260 mm/slub.c:3437
 __do_kmalloc_node mm/slab_common.c:935 [inline]
 __kmalloc+0xa0/0x240 mm/slab_common.c:949
 kmalloc include/linux/slab.h:568 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 fib6_info_alloc+0x2e/0xe0 net/ipv6/ip6_fib.c:156
 ip6_route_info_create+0x44f/0x1210 net/ipv6/route.c:3794
 ip6_route_add+0x24/0x130 net/ipv6/route.c:3890
 addrconf_add_mroute net/ipv6/addrconf.c:2507 [inline]
 addrconf_add_dev+0x253/0x330 net/ipv6/addrconf.c:2525
 addrconf_dev_config net/ipv6/addrconf.c:3425 [inline]
 addrconf_init_auto_addrs+0x60c/0xb00 net/ipv6/addrconf.c:3518
 addrconf_notify+0xaca/0xf40 net/ipv6/addrconf.c:3691
 notifier_call_chain kernel/notifier.c:87 [inline]
 raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:455
 netdev_state_change+0xd2/0x140 net/core/dev.c:1390

Memory state around the buggy address:
 ffff888077f6df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888077f6e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888077f6e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff888077f6e100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888077f6e180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (19):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/10 11:43 linux-6.1.y 04d1ccaa9c28 956bd956 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2025/07/07 02:39 linux-6.1.y 04d1ccaa9c28 4f67c4ae .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2025/05/22 16:02 linux-6.1.y da3c5173c55f 0919b50b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2025/05/22 07:18 linux-6.1.y 325285d9fc86 0919b50b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2025/05/15 02:16 linux-6.1.y 02b72ccb5f9d d6b2ee52 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2025/05/01 05:11 linux-6.1.y 535ec20c5027 ce7952f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2025/04/07 19:38 linux-6.1.y 3dfebb87d7eb a2ada0e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2025/03/14 01:34 linux-6.1.y 344a09659766 e2826670 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2025/02/22 13:34 linux-6.1.y 3a8358583626 d34966d1 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2025/02/04 00:58 linux-6.1.y 0cbb5f65e52f 8f267cef .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2025/01/14 16:36 linux-6.1.y c63962be84ef f310a27d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2024/10/31 07:53 linux-6.1.y 7ec6f9fa3d97 96eb609f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2024/10/30 04:54 linux-6.1.y 7ec6f9fa3d97 66aeb999 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2024/10/25 23:36 linux-6.1.y 7ec6f9fa3d97 045e728d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2024/07/19 14:55 linux-6.1.y 9b3f9a5b12dc ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2024/06/20 17:51 linux-6.1.y eb44d83053d6 dac2aa43 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2024/04/22 01:30 linux-6.1.y 6741e066ec76 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2024/04/15 22:40 linux-6.1.y cd5d98c0556c b9af7e61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
2024/04/06 03:34 linux-6.1.y 347385861c50 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __usb_hcd_giveback_urb
* Struck through repros no longer work on HEAD.