==================================================================
BUG: KASAN: use-after-free in cpu_map_generic_redirect+0x1a8/0x6d0 kernel/bpf/cpumap.c:786
Read of size 8 at addr ffff88810ddd8d18 by task syz.5.1723/6194
CPU: 0 PID: 6194 Comm: syz.5.1723 Not tainted 5.15.178-syzkaller-00013-g7d1f9b5c2ff5 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Call Trace:
 
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106
 print_address_description+0x87/0x3b0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:427 [inline]
 kasan_report+0x179/0x1c0 mm/kasan/report.c:444
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
 cpu_map_generic_redirect+0x1a8/0x6d0 kernel/bpf/cpumap.c:786
 xdp_do_generic_redirect_map net/core/filter.c:4189 [inline]
 xdp_do_generic_redirect+0x3df/0xb40 net/core/filter.c:4236
 do_xdp_generic+0x50b/0x7c0 net/core/dev.c:4919
 __netif_receive_skb_core+0x1706/0x3640 net/core/dev.c:5324
 __netif_receive_skb_one_core net/core/dev.c:5499 [inline]
 __netif_receive_skb+0x11c/0x530 net/core/dev.c:5615
 process_backlog+0x31c/0x650 net/core/dev.c:6492
 __napi_poll+0xc4/0x5a0 net/core/dev.c:7051
 napi_poll net/core/dev.c:7118 [inline]
 net_rx_action+0x47d/0xc50 net/core/dev.c:7208
 handle_softirqs+0x25e/0x5c0 kernel/softirq.c:565
 __do_softirq+0xb/0xd kernel/softirq.c:603
 do_softirq+0xf6/0x150 kernel/softirq.c:452
 
 
 netif_rx_ni+0x5f/0x2d0 net/core/dev.c:5010
 tipc_clone_to_loopback+0x3b9/0x4a0 net/tipc/bearer.c:776
 tipc_loopback_trace net/tipc/bearer.h:253 [inline]
 tipc_node_xmit+0xb83/0xe40 net/tipc/node.c:1701
 tipc_node_xmit_skb net/tipc/node.c:1768 [inline]
 tipc_node_distr_xmit+0x36a/0x4d0 net/tipc/node.c:1783
 tipc_group_delete+0x394/0x430 net/tipc/group.c:226
 tipc_sk_leave+0x1b8/0x700 net/tipc/socket.c:3119
 tipc_release+0x110/0x1300 net/tipc/socket.c:644
 __sock_release net/socket.c:649 [inline]
 sock_close+0xdf/0x270 net/socket.c:1336
 __fput+0x228/0x8c0 fs/file_table.c:280
 ____fput+0x15/0x20 fs/file_table.c:308
 task_work_run+0x129/0x190 kernel/task_work.c:188
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0xc4/0xe0 kernel/entry/common.c:181
 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:307
 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fb0ccde7169
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:00007ffd31dc8518 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007fb0cd001ba0 RCX: 00007fb0ccde7169
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007fb0cd001ba0 R08: 00000000000001a0 R09: 0000001731dc880f
R10: 00007fb0cd001ac0 R11: 0000000000000246 R12: 000000000004ae5d
R13: 00007fb0cd000080 R14: ffffffffffffffff R15: 00007ffd31dc8630
 
Allocated by task 4131:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:45 [inline]
 set_alloc_info mm/kasan/common.c:433 [inline]
 ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:512
 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521
 kasan_kmalloc include/linux/kasan.h:227 [inline]
 __kmalloc+0x13f/0x2c0 mm/slub.c:4431
 kmalloc include/linux/slab.h:608 [inline]
 kzalloc include/linux/slab.h:733 [inline]
 tnode_alloc net/ipv4/fib_trie.c:331 [inline]
 tnode_new+0xca/0x2e0 net/ipv4/fib_trie.c:384
 halve net/ipv4/fib_trie.c:639 [inline]
 resize+0x1103/0x1d60 net/ipv4/fib_trie.c:891
 trie_rebalance net/ipv4/fib_trie.c:1101 [inline]
 fib_remove_alias+0x4a5/0x6e0 net/ipv4/fib_trie.c:1664
 fib_table_delete+0x1159/0x13f0 net/ipv4/fib_trie.c:1767
 fib_magic net/ipv4/fib_frontend.c:1095 [inline]
 fib_del_ifaddr+0x1afb/0x2580 net/ipv4/fib_frontend.c:1306
 fib_inetaddr_event+0xca/0x310 net/ipv4/fib_frontend.c:1437
 notifier_call_chain kernel/notifier.c:83 [inline]
 blocking_notifier_call_chain+0xbb/0x140 kernel/notifier.c:318
 __inet_del_ifa+0x7ff/0xdb0 net/ipv4/devinet.c:444
 inet_del_ifa net/ipv4/devinet.c:481 [inline]
 inetdev_destroy net/ipv4/devinet.c:321 [inline]
 inetdev_event+0x654/0x10a0 net/ipv4/devinet.c:1612
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391
 call_netdevice_notifiers_info net/core/dev.c:2026 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2038 [inline]
 call_netdevice_notifiers net/core/dev.c:2052 [inline]
 unregister_netdevice_many+0xe0a/0x17c0 net/core/dev.c:11118
 default_device_exit_batch+0x38a/0x3f0 net/core/dev.c:11651
 ops_exit_list net/core/net_namespace.c:177 [inline]
 cleanup_net+0x6ce/0xc00 net/core/net_namespace.c:599
 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
 kthread+0x421/0x510 kernel/kthread.c:337
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Last potentially related work creation:
 kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348
 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
 __call_rcu_common kernel/rcu/tree.c:3007 [inline]
 call_rcu+0x123/0x10b0 kernel/rcu/tree.c:3125
 tnode_free net/ipv4/fib_trie.c:495 [inline]
 replace+0x19b/0x4b0 net/ipv4/fib_trie.c:521
 halve net/ipv4/fib_trie.c:678 [inline]
 resize+0x154f/0x1d60 net/ipv4/fib_trie.c:891
 trie_rebalance net/ipv4/fib_trie.c:1101 [inline]
 fib_remove_alias+0x4a5/0x6e0 net/ipv4/fib_trie.c:1664
 fib_table_delete+0x1159/0x13f0 net/ipv4/fib_trie.c:1767
 fib_magic net/ipv4/fib_frontend.c:1095 [inline]
 fib_del_ifaddr+0x1afb/0x2580 net/ipv4/fib_frontend.c:1306
 fib_inetaddr_event+0xca/0x310 net/ipv4/fib_frontend.c:1437
 notifier_call_chain kernel/notifier.c:83 [inline]
 blocking_notifier_call_chain+0xbb/0x140 kernel/notifier.c:318
 __inet_del_ifa+0x7ff/0xdb0 net/ipv4/devinet.c:444
 inet_del_ifa net/ipv4/devinet.c:481 [inline]
 inetdev_destroy net/ipv4/devinet.c:321 [inline]
 inetdev_event+0x654/0x10a0 net/ipv4/devinet.c:1612
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391
 call_netdevice_notifiers_info net/core/dev.c:2026 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2038 [inline]
 call_netdevice_notifiers net/core/dev.c:2052 [inline]
 unregister_netdevice_many+0xe0a/0x17c0 net/core/dev.c:11118
 default_device_exit_batch+0x38a/0x3f0 net/core/dev.c:11651
 ops_exit_list net/core/net_namespace.c:177 [inline]
 cleanup_net+0x6ce/0xc00 net/core/net_namespace.c:599
 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
 kthread+0x421/0x510 kernel/kthread.c:337
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Second to last potentially related work creation:
 kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348
 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
 insert_work+0x56/0x320 kernel/workqueue.c:1373
 __queue_work+0x92a/0xcd0 kernel/workqueue.c:1539
 queue_work_on+0x105/0x170 kernel/workqueue.c:1566
 queue_work include/linux/workqueue.h:510 [inline]
 schedule_work include/linux/workqueue.h:571 [inline]
 __cpu_map_entry_replace kernel/bpf/cpumap.c:555 [inline]
 cpu_map_free+0x1e7/0x2c0 kernel/bpf/cpumap.c:638
 bpf_map_free_deferred+0x10d/0x1e0 kernel/bpf/syscall.c:481
 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
 kthread+0x421/0x510 kernel/kthread.c:337
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
The buggy address belongs to the object at ffff88810ddd8d00
 which belongs to the cache kmalloc-192 of size 192
The buggy address is located 24 bytes inside of
 192-byte region [ffff88810ddd8d00, ffff88810ddd8dc0)
The buggy address belongs to the page:
page:ffffea0004377600 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88810ddd8400 pfn:0x10ddd8
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffffea0004a27a48 ffffea00049d75c8 ffff888100042c00
raw: ffff88810ddd8400 000000000010000b 00000001ffffffff 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 102, ts 4866562905, free_ts 4866541637
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605
 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611
 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485
 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5780
 allocate_slab mm/slub.c:1932 [inline]
 new_slab+0x9a/0x4e0 mm/slub.c:1995
 ___slab_alloc+0x39e/0x830 mm/slub.c:3028
 __slab_alloc+0x4a/0x90 mm/slub.c:3115
 slab_alloc_node mm/slub.c:3206 [inline]
 slab_alloc mm/slub.c:3250 [inline]
 kmem_cache_alloc_trace+0x147/0x270 mm/slub.c:3267
 kmalloc include/linux/slab.h:603 [inline]
 kzalloc include/linux/slab.h:733 [inline]
 kernfs_fop_open+0x324/0xab0 fs/kernfs/file.c:628
 do_dentry_open+0x81c/0xfd0 fs/open.c:828
 vfs_open+0x73/0x80 fs/open.c:958
 do_open fs/namei.c:3608 [inline]
 path_openat+0x26f0/0x2f40 fs/namei.c:3742
 do_filp_open+0x21c/0x460 fs/namei.c:3769
 do_sys_openat2+0x13f/0x820 fs/open.c:1234
 do_sys_open fs/open.c:1250 [inline]
 __do_sys_openat fs/open.c:1266 [inline]
 __se_sys_openat fs/open.c:1261 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1261
 x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1472 [inline]
 free_pcp_prepare mm/page_alloc.c:1544 [inline]
 free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534
 free_unref_page+0xe8/0x750 mm/page_alloc.c:3616
 free_the_page mm/page_alloc.c:805 [inline]
 __free_pages+0x61/0xf0 mm/page_alloc.c:5856
 free_pages+0x7c/0x90 mm/page_alloc.c:5867
 selinux_genfs_get_sid+0x24d/0x2a0 security/selinux/hooks.c:1375
 inode_doinit_with_dentry+0x8d2/0x1070 security/selinux/hooks.c:1570
 selinux_d_instantiate+0x27/0x40 security/selinux/hooks.c:6489
 security_d_instantiate+0x9f/0x100 security/security.c:2074
 d_splice_alias+0x6d/0x390 fs/dcache.c:3071
 kernfs_iop_lookup+0x29e/0x2f0 fs/kernfs/dir.c:1175
 lookup_open fs/namei.c:3440 [inline]
 open_last_lookups fs/namei.c:3532 [inline]
 path_openat+0x1194/0x2f40 fs/namei.c:3739
 do_filp_open+0x21c/0x460 fs/namei.c:3769
 do_sys_openat2+0x13f/0x820 fs/open.c:1234
 do_sys_open fs/open.c:1250 [inline]
 __do_sys_openat fs/open.c:1266 [inline]
 __se_sys_openat fs/open.c:1261 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1261
 x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
Memory state around the buggy address:
 ffff88810ddd8c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88810ddd8c80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff88810ddd8d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff88810ddd8d80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff88810ddd8e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================