================================================================== BUG: KASAN: slab-use-after-free in tcf_action_destroy+0x17f/0x1b0 net/sched/act_api.c:1121 Read of size 8 at addr ffff8880b0cf5a00 by task kworker/u4:9/7253 CPU: 0 PID: 7253 Comm: kworker/u4:9 Not tainted 6.2.0-next-20230303-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Workqueue: tc_filter_workqueue fl_destroy_filter_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:319 print_report mm/kasan/report.c:430 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:536 tcf_action_destroy+0x17f/0x1b0 net/sched/act_api.c:1121 tcf_exts_destroy+0xc5/0x160 net/sched/cls_api.c:3248 __fl_destroy_filter+0x1a/0x100 net/sched/cls_flower.c:418 process_one_work+0x9bf/0x1820 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 29365: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] ____kasan_kmalloc mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:580 [inline] kmalloc_array include/linux/slab.h:635 [inline] kcalloc include/linux/slab.h:667 [inline] tcf_exts_init_ex+0xe4/0x5a0 net/sched/cls_api.c:3218 fl_change+0x56f/0x4ac0 net/sched/cls_flower.c:2237 tc_new_tfilter+0x97c/0x2290 net/sched/cls_api.c:2310 rtnetlink_rcv_msg+0x996/0xd50 net/core/rtnetlink.c:6165 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2574 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:722 [inline] sock_sendmsg+0xde/0x190 net/socket.c:745 ____sys_sendmsg+0x334/0x900 net/socket.c:2504 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2558 __sys_sendmmsg+0x18f/0x460 net/socket.c:2644 __do_sys_sendmmsg net/socket.c:2673 [inline] __se_sys_sendmmsg net/socket.c:2670 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2670 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 29365: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0xaf/0x2d0 mm/slub.c:3800 tcf_exts_destroy+0xe5/0x160 net/sched/cls_api.c:3249 tcf_exts_init_ex net/sched/cls_api.c:3237 [inline] tcf_exts_init_ex+0x484/0x5a0 net/sched/cls_api.c:3205 fl_change+0x56f/0x4ac0 net/sched/cls_flower.c:2237 tc_new_tfilter+0x97c/0x2290 net/sched/cls_api.c:2310 rtnetlink_rcv_msg+0x996/0xd50 net/core/rtnetlink.c:6165 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2574 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:722 [inline] sock_sendmsg+0xde/0x190 net/socket.c:745 ____sys_sendmsg+0x334/0x900 net/socket.c:2504 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2558 __sys_sendmmsg+0x18f/0x460 net/socket.c:2644 __do_sys_sendmmsg net/socket.c:2673 [inline] __se_sys_sendmmsg net/socket.c:2670 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2670 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 kvfree_call_rcu+0x70/0xad0 kernel/rcu/tree.c:3316 drop_sysctl_table+0x3c2/0x4e0 fs/proc/proc_sysctl.c:1714 unregister_sysctl_table fs/proc/proc_sysctl.c:1752 [inline] unregister_sysctl_table+0xc4/0x190 fs/proc/proc_sysctl.c:1727 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7117 [inline] addrconf_exit_net+0xa1/0x3f0 net/ipv6/addrconf.c:7238 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:169 setup_net+0x7fb/0xc50 net/core/net_namespace.c:361 copy_net_ns+0x4ee/0x8e0 net/core/net_namespace.c:490 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 copy_namespaces+0x410/0x500 kernel/nsproxy.c:179 copy_process+0x3129/0x76c0 kernel/fork.c:2407 kernel_clone+0xeb/0xa10 kernel/fork.c:2819 __do_sys_clone3+0x1cd/0x2e0 kernel/fork.c:3118 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880b0cf5a00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of freed 256-byte region [ffff8880b0cf5a00, ffff8880b0cf5b00) The buggy address belongs to the physical page: page:ffffea0002c33d00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xb0cf4 head:ffffea0002c33d00 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888012441b40 ffffea00028c6900 0000000000000003 raw: 0000000000000000 0000000080100010 00000001ffffffff 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 28852, tgid 28850 (syz-executor.0), ts 911446678554, free_ts 862841264523 prep_new_page mm/page_alloc.c:2492 [inline] get_page_from_freelist+0xf75/0x2ad0 mm/page_alloc.c:4256 __alloc_pages+0x1cb/0x5c0 mm/page_alloc.c:5522 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2283 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x28e/0x380 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3193 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x136/0x320 mm/slub.c:3491 __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc+0x4a/0xd0 mm/slab_common.c:980 kmalloc include/linux/slab.h:584 [inline] kzalloc include/linux/slab.h:720 [inline] ops_init+0x16b/0x6b0 net/core/net_namespace.c:125 setup_net+0x5d1/0xc50 net/core/net_namespace.c:338 copy_net_ns+0x4ee/0x8e0 net/core/net_namespace.c:490 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 copy_namespaces+0x410/0x500 kernel/nsproxy.c:179 copy_process+0x3129/0x76c0 kernel/fork.c:2407 kernel_clone+0xeb/0xa10 kernel/fork.c:2819 __do_sys_clone3+0x1cd/0x2e0 kernel/fork.c:3118 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_unref_page_prepare+0x4d1/0xb60 mm/page_alloc.c:3318 free_unref_page_list+0xe3/0xb80 mm/page_alloc.c:3459 release_pages+0xcd7/0x1380 mm/swap.c:1042 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:97 tlb_flush_mmu_free mm/mmu_gather.c:292 [inline] tlb_flush_mmu mm/mmu_gather.c:299 [inline] tlb_finish_mmu+0x14b/0x7e0 mm/mmu_gather.c:391 exit_mmap+0x2b2/0xa70 mm/mmap.c:3066 __mmput+0x13a/0x540 kernel/fork.c:1344 mmput+0x60/0x70 kernel/fork.c:1366 exit_mm kernel/exit.c:563 [inline] do_exit+0x9d7/0x2b60 kernel/exit.c:856 do_group_exit+0xd4/0x2a0 kernel/exit.c:1019 get_signal+0x2315/0x25b0 kernel/signal.c:2859 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:296 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff8880b0cf5900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880b0cf5980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880b0cf5a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880b0cf5a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880b0cf5b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================