BUG: KASAN: slab-use-after-free in tcf_action_destroy+0x17f/0x1b0 net/sched/act_api.c:1121 Read of size 8 at addr ffff8880789c1200 by task kworker/u4:1/11 CPU: 1 PID: 11 Comm: kworker/u4:1 Not tainted 6.2.0-syzkaller-12017-g1ec35eadc3b4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/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 22951: 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/0x4ab0 net/sched/cls_flower.c:2234 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+0x71c/0x900 net/socket.c:2504 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2558 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2587 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 22951: 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/0x4ab0 net/sched/cls_flower.c:2234 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+0x71c/0x900 net/socket.c:2504 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2558 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2587 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 __call_rcu_common.constprop.0+0x99/0x870 kernel/rcu/tree.c:2622 free_fib_info+0x5b/0x90 net/ipv4/fib_semantics.c:257 fib_info_put include/net/ip_fib.h:578 [inline] nsim_fib4_rt_destroy+0x1ae/0x220 drivers/net/netdevsim/fib.c:297 nsim_fib4_rt_replace drivers/net/netdevsim/fib.c:406 [inline] nsim_fib4_rt_insert drivers/net/netdevsim/fib.c:434 [inline] nsim_fib4_event drivers/net/netdevsim/fib.c:464 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:884 [inline] nsim_fib_event_work+0xdca/0x24a0 drivers/net/netdevsim/fib.c:1492 process_one_work+0x9bf/0x1820 kernel/workqueue.c:2390 process_scheduled_works kernel/workqueue.c:2453 [inline] worker_thread+0x858/0x1090 kernel/workqueue.c:2539 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff8880789c1200 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of freed 256-byte region [ffff8880789c1200, ffff8880789c1300) The buggy address belongs to the physical page: page:ffffea0001e27000 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880789c1a00 pfn:0x789c0 head:ffffea0001e27000 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888012441b40 ffffea0000f93f00 0000000000000003 raw: ffff8880789c1a00 000000008010000f 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 21912, tgid 21911 (syz-executor.1), ts 740099344962, free_ts 736477791844 prep_new_page mm/page_alloc.c:2552 [inline] get_page_from_freelist+0x1190/0x2f80 mm/page_alloc.c:4325 __alloc_pages+0x1cb/0x5c0 mm/page_alloc.c:5591 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2283 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x390 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/0x330 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] fib_create_info+0xdbf/0x4c00 net/ipv4/fib_semantics.c:1454 fib_table_insert+0x199/0x1be0 net/ipv4/fib_trie.c:1236 fib_magic+0x493/0x580 net/ipv4/fib_frontend.c:1101 fib_add_ifaddr+0x38d/0x560 net/ipv4/fib_frontend.c:1138 fib_netdev_event+0x38c/0x6f0 net/ipv4/fib_frontend.c:1483 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1937 call_netdevice_notifiers_extack net/core/dev.c:1975 [inline] call_netdevice_notifiers net/core/dev.c:1989 [inline] __dev_notify_flags+0x120/0x2d0 net/core/dev.c:8564 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1453 [inline] free_pcp_prepare+0x668/0xb50 mm/page_alloc.c:1503 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3482 vfree+0x180/0x7e0 mm/vmalloc.c:2742 delayed_vfree_work+0x57/0x70 mm/vmalloc.c:2663 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 Memory state around the buggy address: ffff8880789c1100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880789c1180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880789c1200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880789c1280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880789c1300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================