================================================================== BUG: KASAN: slab-use-after-free in consumer_filter kernel/events/uprobes.c:869 [inline] BUG: KASAN: slab-use-after-free in filter_chain kernel/events/uprobes.c:880 [inline] BUG: KASAN: slab-use-after-free in uprobe_mmap+0xb9a/0x11a0 kernel/events/uprobes.c:1387 Read of size 8 at addr ffff8880651d4730 by task syz.1.5656/31781 CPU: 0 UID: 0 PID: 31781 Comm: syz.1.5656 Not tainted 6.11.0-rc6-syzkaller-00026-g88fac17500f4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 consumer_filter kernel/events/uprobes.c:869 [inline] filter_chain kernel/events/uprobes.c:880 [inline] uprobe_mmap+0xb9a/0x11a0 kernel/events/uprobes.c:1387 mmap_region+0x1891/0x2090 mm/mmap.c:3058 do_mmap+0x8f9/0x1010 mm/mmap.c:1468 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588 ksys_mmap_pgoff+0x4f1/0x720 mm/mmap.c:1514 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f755c37cef9 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:00007f755d262038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f755c535f80 RCX: 00007f755c37cef9 RDX: 0000000000000000 RSI: 0000000000400000 RDI: 0000000020000000 RBP: 00007f755c3ef01e R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000010012 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f755c535f80 R15: 00007ffccd2a1168 Allocated by task 16747: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __kmalloc_cache_noprof+0x19c/0x2c0 mm/slub.c:4189 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] sctp_inet6addr_event+0x366/0x730 net/sctp/ipv6.c:86 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 atomic_notifier_call_chain+0xdb/0x180 kernel/notifier.c:231 ipv6_add_addr+0xde0/0x1090 net/ipv6/addrconf.c:1180 addrconf_add_linklocal+0x36c/0xa30 net/ipv6/addrconf.c:3315 addrconf_addr_gen+0x510/0xbb0 addrconf_dev_config net/ipv6/addrconf.c:3492 [inline] addrconf_init_auto_addrs+0x96a/0xeb0 net/ipv6/addrconf.c:3570 addrconf_notify+0xaff/0x1020 net/ipv6/addrconf.c:3743 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 netdev_state_change+0x11f/0x1a0 net/core/dev.c:1376 linkwatch_do_dev+0x112/0x170 net/core/link_watch.c:177 __linkwatch_run_queue+0x44f/0x6c0 net/core/link_watch.c:234 linkwatch_event+0x4c/0x60 net/core/link_watch.c:277 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd10 kernel/workqueue.c:3389 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 5270: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kfree+0x149/0x360 mm/slub.c:4594 kvfree_rcu_list+0xf9/0x280 kernel/rcu/tree.c:3443 kfree_rcu_work+0x3f2/0x500 kernel/rcu/tree.c:3495 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd10 kernel/workqueue.c:3389 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/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+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 kvfree_call_rcu+0xfc/0x790 kernel/rcu/tree.c:3815 sctp_inet6addr_event+0x693/0x730 net/sctp/ipv6.c:115 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 atomic_notifier_call_chain+0xdb/0x180 kernel/notifier.c:231 addrconf_ifdown+0xefd/0x1bd0 net/ipv6/addrconf.c:3981 addrconf_notify+0x3cb/0x1020 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:2032 [inline] call_netdevice_notifiers net/core/dev.c:2046 [inline] dev_close_many+0x33c/0x4c0 net/core/dev.c:1587 unregister_netdevice_many_notify+0x50b/0x1c40 net/core/dev.c:11327 unregister_netdevice_many net/core/dev.c:11414 [inline] default_device_exit_batch+0xa0f/0xa90 net/core/dev.c:11897 ops_exit_list net/core/net_namespace.c:178 [inline] cleanup_net+0x89d/0xcc0 net/core/net_namespace.c:640 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd10 kernel/workqueue.c:3389 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/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 ffff8880651d4700 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 48 bytes inside of freed 64-byte region [ffff8880651d4700, ffff8880651d4740) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880651d4580 pfn:0x651d4 flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000200 ffff88801a8418c0 ffffea0001220cd0 ffffea0000b8b190 raw: ffff8880651d4580 0000000000200001 00000001fdffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5230, tgid 5230 (syz-executor), ts 56885757229, free_ts 15088327005 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3439 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4695 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] __do_kmalloc_node mm/slub.c:4157 [inline] __kmalloc_node_track_caller_noprof+0x281/0x440 mm/slub.c:4177 kmemdup_noprof+0x2a/0x60 mm/util.c:133 mpls_dev_sysctl_register+0xd1/0x280 net/mpls/af_mpls.c:1391 mpls_add_dev net/mpls/af_mpls.c:1461 [inline] mpls_dev_notify+0x33f/0x7a0 net/mpls/af_mpls.c:1601 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:2032 [inline] call_netdevice_notifiers net/core/dev.c:2046 [inline] register_netdevice+0x167f/0x1b00 net/core/dev.c:10477 __ip_tunnel_create+0x2b4/0x380 net/ipv4/ip_tunnel.c:266 ip_tunnel_init_net+0x21c/0x710 net/ipv4/ip_tunnel.c:1159 ops_init+0x359/0x610 net/core/net_namespace.c:139 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xd19/0xea0 mm/page_alloc.c:2612 free_contig_range+0x9e/0x160 mm/page_alloc.c:6660 destroy_args+0x8a/0x890 mm/debug_vm_pgtable.c:1017 debug_vm_pgtable+0x4be/0x550 mm/debug_vm_pgtable.c:1397 do_one_initcall+0x248/0x880 init/main.c:1267 do_initcall_level+0x157/0x210 init/main.c:1329 do_initcalls+0x3f/0x80 init/main.c:1345 kernel_init_freeable+0x435/0x5d0 init/main.c:1578 kernel_init+0x1d/0x2b0 init/main.c:1467 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff8880651d4600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880651d4680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8880651d4700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880651d4780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880651d4800: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================