syzbot


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

Status: upstream: reported on 2025/05/02 23:13
Subsystems: media
[Documentation on labels]
Reported-by: syzbot+47321e8fd5a4c84088db@syzkaller.appspotmail.com
First crash: 129d, last: 3d08h
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] media: usb: as102: reset file private data on device release 1 (1) 2025/05/07 11:18
[syzbot] [media?] KASAN: slab-use-after-free Write in as102_release (2) 0 (1) 2025/05/02 23:13
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Write in as102_release media 9 236d 240d 0/29 auto-obsoleted due to no activity on 2025/02/01 23:16

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_fetch_sub_release include/linux/atomic/atomic-instrumented.h:400 [inline]
BUG: KASAN: slab-use-after-free in __refcount_sub_and_test include/linux/refcount.h:389 [inline]
BUG: KASAN: slab-use-after-free in __refcount_dec_and_test include/linux/refcount.h:432 [inline]
BUG: KASAN: slab-use-after-free in refcount_dec_and_test include/linux/refcount.h:450 [inline]
BUG: KASAN: slab-use-after-free in kref_put include/linux/kref.h:64 [inline]
BUG: KASAN: slab-use-after-free in as102_release+0x56/0x110 drivers/media/usb/as102/as102_usb_drv.c:456
Write of size 4 at addr ffff88805603a150 by task syz.3.846/9190

CPU: 0 UID: 0 PID: 9190 Comm: syz.3.846 Not tainted 6.15.0-syzkaller-03645-g3d413f0cfd7e #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 __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_fetch_sub_release include/linux/atomic/atomic-instrumented.h:400 [inline]
 __refcount_sub_and_test include/linux/refcount.h:389 [inline]
 __refcount_dec_and_test include/linux/refcount.h:432 [inline]
 refcount_dec_and_test include/linux/refcount.h:450 [inline]
 kref_put include/linux/kref.h:64 [inline]
 as102_release+0x56/0x110 drivers/media/usb/as102/as102_usb_drv.c:456
 __fput+0x402/0xb70 fs/file_table.c:465
 task_work_run+0x14d/0x240 kernel/task_work.c:227
 exit_task_work include/linux/task_work.h:40 [inline]
 do_exit+0xae2/0x2c70 kernel/exit.c:959
 do_group_exit+0xd3/0x2a0 kernel/exit.c:1108
 get_signal+0x2673/0x26d0 kernel/signal.c:3034
 arch_do_signal_or_restart+0x8f/0x7d0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop+0x84/0x110 kernel/entry/common.c:111
 exit_to_user_mode_prepare include/linux/entry-common.h:330 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:414 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:449 [inline]
 do_syscall_64+0x3f6/0x4c0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa11a98e969
Code: Unable to access opcode bytes at 0x7fa11a98e93f.
RSP: 002b:00007fa1187f60e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007fa11abb6088 RCX: 00007fa11a98e969
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fa11abb6088
RBP: 00007fa11abb6080 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fa11abb608c
R13: 0000000000000000 R14: 00007ffefd4c03b0 R15: 00007ffefd4c0498
 </TASK>

Allocated by task 5868:
 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]
 as102_usb_probe+0x54/0xb00 drivers/media/usb/as102/as102_usb_drv.c:348
 usb_probe_interface+0x300/0x9c0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:579 [inline]
 really_probe+0x241/0xa90 drivers/base/dd.c:657
 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:799
 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:829
 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:957
 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:462
 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:1029
 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537
 device_add+0x1148/0x1a70 drivers/base/core.c:3692
 usb_set_configuration+0x1187/0x1e20 drivers/usb/core/message.c:2210
 usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:250
 usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:579 [inline]
 really_probe+0x241/0xa90 drivers/base/dd.c:657
 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:799
 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:829
 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:957
 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:462
 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:1029
 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537
 device_add+0x1148/0x1a70 drivers/base/core.c:3692
 usb_new_device+0xd07/0x1a20 drivers/usb/core/hub.c:2663
 hub_port_connect drivers/usb/core/hub.c:5531 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5671 [inline]
 port_event drivers/usb/core/hub.c:5831 [inline]
 hub_event+0x2eb7/0x4fa0 drivers/usb/core/hub.c:5913
 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238
 process_scheduled_works kernel/workqueue.c:3321 [inline]
 worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402
 kthread+0x3c5/0x780 kernel/kthread.c:464
 ret_from_fork+0x5d4/0x6f0 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Freed by task 5868:
 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
 as102_usb_probe+0x697/0xb00 drivers/media/usb/as102/as102_usb_drv.c:410
 usb_probe_interface+0x300/0x9c0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:579 [inline]
 really_probe+0x241/0xa90 drivers/base/dd.c:657
 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:799
 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:829
 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:957
 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:462
 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:1029
 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537
 device_add+0x1148/0x1a70 drivers/base/core.c:3692
 usb_set_configuration+0x1187/0x1e20 drivers/usb/core/message.c:2210
 usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:250
 usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:579 [inline]
 really_probe+0x241/0xa90 drivers/base/dd.c:657
 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:799
 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:829
 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:957
 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:462
 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:1029
 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537
 device_add+0x1148/0x1a70 drivers/base/core.c:3692
 usb_new_device+0xd07/0x1a20 drivers/usb/core/hub.c:2663
 hub_port_connect drivers/usb/core/hub.c:5531 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5671 [inline]
 port_event drivers/usb/core/hub.c:5831 [inline]
 hub_event+0x2eb7/0x4fa0 drivers/usb/core/hub.c:5913
 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238
 process_scheduled_works kernel/workqueue.c:3321 [inline]
 worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402
 kthread+0x3c5/0x780 kernel/kthread.c:464
 ret_from_fork+0x5d4/0x6f0 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

The buggy address belongs to the object at ffff88805603a000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 336 bytes inside of
 freed 4096-byte region [ffff88805603a000, ffff88805603b000)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x56038
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 ffff88801b442140 ffffea0000d8f800 dead000000000002
raw: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b442140 ffffea0000d8f800 dead000000000002
head: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000
head: 00fff00000000003 ffffea0001580e01 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 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5834, tgid 5834 (udevd), ts 159033444252, free_ts 158600905233
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1714
 prep_new_page mm/page_alloc.c:1722 [inline]
 get_page_from_freelist+0x135c/0x3950 mm/page_alloc.c:3684
 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:4974
 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]
 __do_kmalloc_node mm/slub.c:4326 [inline]
 __kmalloc_noprof+0x2f2/0x510 mm/slub.c:4339
 kmalloc_noprof include/linux/slab.h:909 [inline]
 tomoyo_realpath_from_path+0xc2/0x6e0 security/tomoyo/realpath.c:251
 tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
 tomoyo_path_perm+0x274/0x460 security/tomoyo/file.c:822
 security_inode_getattr+0x116/0x290 security/security.c:2377
 vfs_getattr fs/stat.c:259 [inline]
 vfs_statx_path fs/stat.c:299 [inline]
 vfs_statx+0x121/0x3e0 fs/stat.c:356
 vfs_fstatat+0x7b/0xf0 fs/stat.c:375
 __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
page last free pid 6867 tgid 6861 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1258 [inline]
 __free_frozen_pages+0x7f8/0x1180 mm/page_alloc.c:2721
 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]
 kmem_cache_alloc_node_noprof+0x1d5/0x3b0 mm/slub.c:4248
 __alloc_skb+0x2b2/0x380 net/core/skbuff.c:658
 alloc_skb include/linux/skbuff.h:1340 [inline]
 nlmsg_new include/net/netlink.h:1019 [inline]
 inet_ifmcaddr_notify+0xc7/0x1c0 net/ipv4/igmp.c:1481
 __ip_mc_dec_group+0x442/0x5b0 net/ipv4/igmp.c:1778
 inetdev_event+0x3b2/0x18a0 net/ipv4/devinet.c:1642
 notifier_call_chain+0xbc/0x410 kernel/notifier.c:85
 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:2176
 call_netdevice_notifiers_extack net/core/dev.c:2214 [inline]
 call_netdevice_notifiers net/core/dev.c:2228 [inline]
 dev_close_many+0x319/0x630 net/core/dev.c:1731
 netif_close net/core/dev.c:1744 [inline]
 netif_close+0x17f/0x230 net/core/dev.c:1738
 dev_close+0xaa/0x240 net/core/dev_api.c:219
 cfg80211_shutdown_all_interfaces+0x9a/0x200 net/wireless/core.c:277

Memory state around the buggy address:
 ffff88805603a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88805603a080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88805603a100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                 ^
 ffff88805603a180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88805603a200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (20):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/29 03:34 upstream 3d413f0cfd7e 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root KASAN: slab-use-after-free Write in as102_release
2025/05/17 19:28 upstream 172a9d94339c f41472b0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Write in as102_release
2025/06/15 14:18 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 19272b37aa4f 5f4b362d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/06/13 20:49 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 19272b37aa4f 98683f8f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/06/13 05:07 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 19272b37aa4f 98683f8f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/06/12 22:28 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 19272b37aa4f 98683f8f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/06/11 04:21 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 19272b37aa4f 5d7e17ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/05/31 12:54 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 882826f58b2c 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/05/27 09:28 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 882826f58b2c 874a1386 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/05/24 01:33 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d1d89e8eee6f f8cc0c83 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/05/22 07:52 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 342e4955a1f1 0919b50b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/05/18 23:47 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing ab6dc9a6c721 f41472b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/05/11 22:52 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 588d032e9e56 77908e5f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/05/04 06:47 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 588d032e9e56 b0714e37 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/05/03 23:28 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 588d032e9e56 b0714e37 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/05/02 23:12 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 588d032e9e56 b0714e37 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/05/02 02:53 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 588d032e9e56 51b137cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/03/17 14:06 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 3a85c1011540 948c34e4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/02/13 04:54 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9682c35ff6ec b27c2402 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
2025/02/09 03:27 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9682c35ff6ec ef44b750 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-usb KASAN: slab-use-after-free Write in as102_release
* Struck through repros no longer work on HEAD.