syzbot


KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups (2)

Status: upstream: reported C repro on 2024/04/01 16:50
Subsystems: usb
[Documentation on labels]
Reported-by: syzbot+[email protected]
First crash: 454d, last: 7d17h
Cause bisection: failed (error log, bisect log)
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [usb?] KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups (2) 1 (3) 2024/04/02 03:52
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups usb C done unreliable 14 600d 789d 0/29 auto-obsoleted due to no activity on 2024/02/14 08:18
linux-6.1 KASAN: use-after-free Write in usb_anchor_suspend_wakeups origin:upstream C error 1 170d 170d 0/3 upstream: reported C repro on 2025/01/09 05:11
linux-5.15 KASAN: use-after-free Write in usb_anchor_suspend_wakeups origin:upstream missing-backport C inconclusive 1 262d 766d 0/3 auto-obsoleted due to no activity on 2025/01/17 06:55
Last patch testing requests (11)
Created Duration User Patch Repo Result
2025/06/16 11:31 23m retest repro upstream report log
2025/05/22 09:29 16m retest repro upstream report log
2025/05/22 09:29 13m retest repro upstream report log
2025/04/08 03:35 16m retest repro upstream report log
2025/03/24 12:17 55m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log
2025/03/10 11:54 13m retest repro upstream report log
2025/02/24 11:24 16m retest repro upstream report log
2025/01/21 14:43 15m retest repro upstream report log
2025/01/03 13:33 29m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log
2024/12/20 10:57 12m retest repro upstream report log
2024/04/01 23:02 25m [email protected] patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 480e035fc4c7 OK log
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2024/10/15 23:06 2h55m bisect fix upstream OK (0) job log log
2024/09/03 02:36 1h47m bisect fix upstream OK (0) job log log
2024/08/03 22:52 1h45m bisect fix upstream OK (0) job log log

Sample crash report:
BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline]
BUG: KASAN: slab-use-after-free in atomic_inc include/linux/atomic/atomic-instrumented.h:435 [inline]
BUG: KASAN: slab-use-after-free in usb_anchor_suspend_wakeups drivers/usb/core/urb.c:927 [inline]
BUG: KASAN: slab-use-after-free in usb_anchor_suspend_wakeups+0x28/0x40 drivers/usb/core/urb.c:924
Write of size 4 at addr ffff88807d282910 by task udevd/5917

CPU: 0 UID: 0 PID: 5917 Comm: udevd Not tainted 6.15.0-syzkaller-10401-gdee264c16a63 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:408 [inline]
 print_report+0xcd/0x680 mm/kasan/report.c:521
 kasan_report+0xe0/0x110 mm/kasan/report.c:634
 check_region_inline mm/kasan/generic.c:183 [inline]
 kasan_check_range+0x100/0x1b0 mm/kasan/generic.c:189
 instrument_atomic_read_write include/linux/instrumented.h:96 [inline]
 atomic_inc include/linux/atomic/atomic-instrumented.h:435 [inline]
 usb_anchor_suspend_wakeups drivers/usb/core/urb.c:927 [inline]
 usb_anchor_suspend_wakeups+0x28/0x40 drivers/usb/core/urb.c:924
 __usb_hcd_giveback_urb+0x224/0x6e0 drivers/usb/core/hcd.c:1636
 usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1734
 dummy_timer+0x180e/0x3a20 drivers/usb/gadget/udc/dummy_hcd.c:1994
 __run_hrtimer kernel/time/hrtimer.c:1761 [inline]
 __hrtimer_run_queues+0x202/0xad0 kernel/time/hrtimer.c:1825
 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1842
 handle_softirqs+0x219/0x8e0 kernel/softirq.c:579
 __do_softirq kernel/softirq.c:613 [inline]
 invoke_softirq kernel/softirq.c:453 [inline]
 __irq_exit_rcu+0x109/0x170 kernel/softirq.c:680
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline]
 sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1050
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:unwind_get_return_address+0x4e/0xa0 arch/x86/kernel/unwind_orc.c:369
Code: 7e 59 8b 03 85 c0 75 09 31 c0 5b 5d c3 cc cc cc cc 48 b8 00 00 00 00 00 fc ff df 48 8d 6b 48 48 89 ea 48 c1 ea 03 80 3c 02 00 <75> 36 48 8b 7b 48 e8 e7 8d 1a 00 85 c0 74 cf 48 b8 00 00 00 00 00
RSP: 0018:ffffc9000488f950 EFLAGS: 00000246
RAX: dffffc0000000000 RBX: ffffc9000488f968 RCX: ffffc9000488fa00
RDX: 1ffff92000911f36 RSI: ffffffff8dde190c RDI: ffffc9000488f968
RBP: ffffc9000488f9b0 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 00000000000061d7 R12: ffffffff81a754e0
R13: ffffc9000488fa28 R14: 0000000000000000 R15: ffff88807f710000
 arch_stack_walk+0xa6/0x100 arch/x86/kernel/stacktrace.c:26
 stack_trace_save+0x8e/0xc0 kernel/stacktrace.c:122
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576
 poison_slab_object mm/kasan/common.c:247 [inline]
 __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264
 kasan_slab_free include/linux/kasan.h:233 [inline]
 slab_free_hook mm/slub.c:2380 [inline]
 slab_free mm/slub.c:4642 [inline]
 kmem_cache_free+0x2d1/0x4d0 mm/slub.c:4744
 putname+0x154/0x1a0 fs/namei.c:297
 vfs_fstatat+0x85/0xf0 fs/stat.c:376
 __do_sys_newfstatat+0x97/0x120 fs/stat.c:542
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb746911b0a
Code: 48 8b 15 f1 f2 0d 00 f7 d8 64 89 02 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 41 89 ca b8 06 01 00 00 0f 05 <3d> 00 f0 ff ff 77 07 31 c0 c3 0f 1f 40 00 48 8b 15 b9 f2 0d 00 f7
RSP: 002b:00007ffdafb29378 EFLAGS: 00000246 ORIG_RAX: 0000000000000106
RAX: ffffffffffffffda RBX: 00007ffdafb29810 RCX: 00007fb746911b0a
RDX: 00007ffdafb29380 RSI: 00007ffdafb29810 RDI: 00000000ffffff9c
RBP: 000055c48beb22c0 R08: 0000000000000000 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffdafb29410
R13: 00007ffdafb29c45 R14: 00007ffdafb2a541 R15: 000055c464f9800c
 </TASK>

Allocated by task 6104:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394
 kmalloc_noprof include/linux/slab.h:905 [inline]
 kzalloc_noprof include/linux/slab.h:1039 [inline]
 usbtmc_open+0xa9/0x9b0 drivers/usb/class/usbtmc.c:175
 usb_open+0x186/0x220 drivers/usb/core/file.c:47
 chrdev_open+0x234/0x6a0 fs/char_dev.c:414
 do_dentry_open+0x744/0x1c10 fs/open.c:964
 vfs_open+0x82/0x3f0 fs/open.c:1094
 do_open fs/namei.c:3887 [inline]
 path_openat+0x1de4/0x2cb0 fs/namei.c:4046
 do_filp_open+0x20b/0x470 fs/namei.c:4073
 do_sys_openat2+0x11b/0x1d0 fs/open.c:1437
 do_sys_open fs/open.c:1452 [inline]
 __do_sys_openat fs/open.c:1468 [inline]
 __se_sys_openat fs/open.c:1463 [inline]
 __x64_sys_openat+0x174/0x210 fs/open.c:1463
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 6104:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576
 poison_slab_object mm/kasan/common.c:247 [inline]
 __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264
 kasan_slab_free include/linux/kasan.h:233 [inline]
 slab_free_hook mm/slub.c:2380 [inline]
 slab_free mm/slub.c:4642 [inline]
 kfree+0x2b4/0x4d0 mm/slub.c:4841
 usbtmc_release+0x271/0x380 drivers/usb/class/usbtmc.c:261
 __fput+0x402/0xb70 fs/file_table.c:465
 task_work_run+0x150/0x240 kernel/task_work.c:227
 ptrace_notify+0x10e/0x130 kernel/signal.c:2520
 ptrace_report_syscall include/linux/ptrace.h:415 [inline]
 ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline]
 syscall_exit_work+0x17c/0x1e0 kernel/entry/common.c:173
 syscall_exit_to_user_mode_work include/linux/entry-common.h:412 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:449 [inline]
 do_syscall_64+0x3e6/0x4c0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff88807d282800
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 272 bytes inside of
 freed 1024-byte region [ffff88807d282800, ffff88807d282c00)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7d280
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801b841dc0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b841dc0 dead000000000100 dead000000000122
head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
head: 00fff00000000003 ffffea0001f4a001 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 6007, tgid 6006 (syz-executor331), ts 81558111715, free_ts 81528650887
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1710
 prep_new_page mm/page_alloc.c:1718 [inline]
 get_page_from_freelist+0x135c/0x3950 mm/page_alloc.c:3680
 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:4970
 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2301
 alloc_slab_page mm/slub.c:2450 [inline]
 allocate_slab mm/slub.c:2618 [inline]
 new_slab+0x23b/0x330 mm/slub.c:2672
 ___slab_alloc+0xd9c/0x1940 mm/slub.c:3858
 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3948
 __slab_alloc_node mm/slub.c:4023 [inline]
 slab_alloc_node mm/slub.c:4184 [inline]
 __kmalloc_cache_noprof+0xfb/0x3e0 mm/slub.c:4353
 kmalloc_noprof include/linux/slab.h:905 [inline]
 kzalloc_noprof include/linux/slab.h:1039 [inline]
 usbtmc_open+0xa9/0x9b0 drivers/usb/class/usbtmc.c:175
 usb_open+0x186/0x220 drivers/usb/core/file.c:47
 chrdev_open+0x234/0x6a0 fs/char_dev.c:414
 do_dentry_open+0x744/0x1c10 fs/open.c:964
 vfs_open+0x82/0x3f0 fs/open.c:1094
 do_open fs/namei.c:3887 [inline]
 path_openat+0x1de4/0x2cb0 fs/namei.c:4046
 do_filp_open+0x20b/0x470 fs/namei.c:4073
 do_sys_openat2+0x11b/0x1d0 fs/open.c:1437
page last free pid 6011 tgid 6010 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1254 [inline]
 __free_frozen_pages+0x7fe/0x1180 mm/page_alloc.c:2717
 discard_slab mm/slub.c:2716 [inline]
 __put_partials+0x16d/0x1c0 mm/slub.c:3185
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x4d/0x120 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329
 kasan_slab_alloc include/linux/kasan.h:250 [inline]
 slab_post_alloc_hook mm/slub.c:4147 [inline]
 slab_alloc_node mm/slub.c:4196 [inline]
 __kmalloc_cache_noprof+0x1f1/0x3e0 mm/slub.c:4353
 kmalloc_noprof include/linux/slab.h:905 [inline]
 kzalloc_noprof include/linux/slab.h:1039 [inline]
 usbtmc_open+0xa9/0x9b0 drivers/usb/class/usbtmc.c:175
 usb_open+0x186/0x220 drivers/usb/core/file.c:47
 chrdev_open+0x234/0x6a0 fs/char_dev.c:414
 do_dentry_open+0x744/0x1c10 fs/open.c:964
 vfs_open+0x82/0x3f0 fs/open.c:1094
 do_open fs/namei.c:3887 [inline]
 path_openat+0x1de4/0x2cb0 fs/namei.c:4046
 do_filp_open+0x20b/0x470 fs/namei.c:4073
 do_sys_openat2+0x11b/0x1d0 fs/open.c:1437
 do_sys_open fs/open.c:1452 [inline]
 __do_sys_openat fs/open.c:1468 [inline]
 __se_sys_openat fs/open.c:1463 [inline]
 __x64_sys_openat+0x174/0x210 fs/open.c:1463
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94

Memory state around the buggy address:
 ffff88807d282800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88807d282880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807d282900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff88807d282980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88807d282a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
   0:	7e 59                	jle    0x5b
   2:	8b 03                	mov    (%rbx),%eax
   4:	85 c0                	test   %eax,%eax
   6:	75 09                	jne    0x11
   8:	31 c0                	xor    %eax,%eax
   a:	5b                   	pop    %rbx
   b:	5d                   	pop    %rbp
   c:	c3                   	ret
   d:	cc                   	int3
   e:	cc                   	int3
   f:	cc                   	int3
  10:	cc                   	int3
  11:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  18:	fc ff df
  1b:	48 8d 6b 48          	lea    0x48(%rbx),%rbp
  1f:	48 89 ea             	mov    %rbp,%rdx
  22:	48 c1 ea 03          	shr    $0x3,%rdx
  26:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
* 2a:	75 36                	jne    0x62 <-- trapping instruction
  2c:	48 8b 7b 48          	mov    0x48(%rbx),%rdi
  30:	e8 e7 8d 1a 00       	call   0x1a8e1c
  35:	85 c0                	test   %eax,%eax
  37:	74 cf                	je     0x8
  39:	48                   	rex.W
  3a:	b8 00 00 00 00       	mov    $0x0,%eax

Crashes (16):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/31 22:08 upstream dee264c16a63 3d2f584d .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2025/04/30 00:43 upstream ca91b9500108 aeb6ec69 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2024/03/31 05:29 upstream 480e035fc4c7 6baf5069 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2025/02/10 11:06 upstream a64dcfb451e2 ef44b750 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2024/12/06 10:57 upstream 5076001689e4 946d28f0 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2024/11/23 12:23 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 7b1d1d4cfac0 68da6d95 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2025/06/20 23:24 upstream 75f5f23f8787 e3003213 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2025/05/08 08:49 upstream 707df3375124 dbf35fa1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2024/05/05 01:39 upstream 3d25a941ea50 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2024/04/03 22:10 upstream 480e035fc4c7 fed899ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2024/03/31 05:00 upstream 480e035fc4c7 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2025/01/07 14:34 upstream fbfd64d25c7a f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2025/06/02 08:22 upstream cd2e103d57e5 3d2f584d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2025/05/29 03:08 upstream feacb1774bd5 3d2f584d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2024/11/19 08:24 upstream 9fb2cfa4635a 571351cb .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
2024/09/15 18:07 upstream 98f7e32f20d2 08d8a733 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: slab-use-after-free Write in usb_anchor_suspend_wakeups
* Struck through repros no longer work on HEAD.
OSZAR »