================================================================== BUG: KASAN: slab-use-after-free in dvb_device_open+0x36a/0x3b0 drivers/media/dvb-core/dvbdev.c:99 Read of size 8 at addr ffff888028fcce18 by task syz.9.2043/15250 CPU: 1 UID: 0 PID: 15250 Comm: syz.9.2043 Not tainted 6.13.0-rc5-syzkaller-00012-g0bc21e701a6f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __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:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 dvb_device_open+0x36a/0x3b0 drivers/media/dvb-core/dvbdev.c:99 chrdev_open+0x237/0x6a0 fs/char_dev.c:414 do_dentry_open+0xf59/0x1ea0 fs/open.c:945 vfs_open+0x82/0x3f0 fs/open.c:1075 do_open fs/namei.c:3828 [inline] path_openat+0x1e6a/0x2d60 fs/namei.c:3987 do_filp_open+0x20c/0x470 fs/namei.c:4014 do_sys_openat2+0x17a/0x1e0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_sys_openat fs/open.c:1433 [inline] __se_sys_openat fs/open.c:1428 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1428 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa124d85d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa125c0f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fa124f75fa0 RCX: 00007fa124d85d29 RDX: 0000000000082900 RSI: 0000000020000040 RDI: ffffffffffffff9c RBP: 00007fa124e01b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fa124f75fa0 R15: 00007ffc59645858 Allocated by task 15045: 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 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4298 [inline] __kmalloc_noprof+0x21a/0x4f0 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] new_dir fs/proc/proc_sysctl.c:962 [inline] get_subdir fs/proc/proc_sysctl.c:1006 [inline] sysctl_mkdir_p fs/proc/proc_sysctl.c:1316 [inline] __register_sysctl_table+0xeac/0x18c0 fs/proc/proc_sysctl.c:1391 mpls_dev_sysctl_register+0x186/0x2a0 net/mpls/af_mpls.c:1405 mpls_add_dev net/mpls/af_mpls.c:1460 [inline] mpls_dev_notify+0x4ac/0xa20 net/mpls/af_mpls.c:1600 notifier_call_chain+0xb7/0x410 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1996 call_netdevice_notifiers_extack net/core/dev.c:2034 [inline] call_netdevice_notifiers net/core/dev.c:2048 [inline] register_netdevice+0x1728/0x1e20 net/core/dev.c:10632 register_netdev+0x2f/0x50 net/core/dev.c:10736 vti6_init_net+0x25e/0x3d0 net/ipv6/ip6_vti.c:1155 ops_init+0x1df/0x5f0 net/core/net_namespace.c:138 setup_net+0x21f/0x860 net/core/net_namespace.c:362 copy_net_ns+0x2b4/0x6c0 net/core/net_namespace.c:516 create_new_namespaces+0x3ea/0xad0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:228 ksys_unshare+0x45d/0xa40 kernel/fork.c:3333 __do_sys_unshare kernel/fork.c:3404 [inline] __se_sys_unshare kernel/fork.c:3402 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3402 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 13495: 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:582 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:2353 [inline] slab_free_freelist_hook mm/slub.c:2382 [inline] slab_free_bulk mm/slub.c:4637 [inline] kmem_cache_free_bulk.part.0+0x293/0x7f0 mm/slub.c:5001 kfree_bulk include/linux/slab.h:790 [inline] kvfree_rcu_bulk+0x454/0x550 kernel/rcu/tree.c:3385 kfree_rcu_work+0x2f2/0x5a0 kernel/rcu/tree.c:3464 process_one_work+0x958/0x1b30 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:544 kvfree_call_rcu+0x74/0xbe0 kernel/rcu/tree.c:3820 drop_sysctl_table+0x356/0x5f0 fs/proc/proc_sysctl.c:1517 unregister_sysctl_table fs/proc/proc_sysctl.c:1538 [inline] unregister_sysctl_table+0x41/0x60 fs/proc/proc_sysctl.c:1530 mpls_dev_sysctl_unregister net/mpls/af_mpls.c:1429 [inline] mpls_dev_notify+0x70d/0xa20 net/mpls/af_mpls.c:1641 notifier_call_chain+0xb7/0x410 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1996 call_netdevice_notifiers_extack net/core/dev.c:2034 [inline] call_netdevice_notifiers net/core/dev.c:2048 [inline] unregister_netdevice_many_notify+0x8d5/0x1e60 net/core/dev.c:11526 cleanup_net+0x58c/0xbd0 net/core/net_namespace.c:643 process_one_work+0x958/0x1b30 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff888028fcce00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 24 bytes inside of freed 256-byte region [ffff888028fcce00, ffff888028fccf00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888028fcce00 pfn:0x28fcc head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801ac41b40 ffffea0000c8b890 ffffea0001e72f90 raw: ffff888028fcce00 000000000010000f 00000001f5000000 0000000000000000 head: 00fff00000000240 ffff88801ac41b40 ffffea0000c8b890 ffffea0001e72f90 head: ffff888028fcce00 000000000010000f 00000001f5000000 0000000000000000 head: 00fff00000000001 ffffea0000a3f301 ffffffffffffffff 0000000000000000 head: 0000000000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 14417837803, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3476 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2589 [inline] new_slab+0x2c9/0x410 mm/slub.c:2642 ___slab_alloc+0xce2/0x1650 mm/slub.c:3830 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __kmalloc_cache_noprof+0xf6/0x420 mm/slub.c:4324 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] bus_add_driver+0x92/0x690 drivers/base/bus.c:659 driver_register+0x15c/0x4b0 drivers/base/driver.c:246 usb_register_driver+0x216/0x4d0 drivers/usb/core/driver.c:1078 uvc_init+0x24/0x60 drivers/media/usb/uvc/uvc_driver.c:3170 do_one_initcall+0x128/0x630 init/main.c:1266 do_initcall_level init/main.c:1328 [inline] do_initcalls init/main.c:1344 [inline] do_basic_setup init/main.c:1363 [inline] kernel_init_freeable+0x58f/0x8b0 init/main.c:1577 kernel_init+0x1c/0x2b0 init/main.c:1466 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 page_owner free stack trace missing Memory state around the buggy address: ffff888028fccd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888028fccd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888028fcce00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888028fcce80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028fccf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================