netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. ================================================================== BUG: KASAN: slab-use-after-free in mini_qdisc_pair_swap+0x1b1/0x1d0 net/sched/sch_generic.c:1573 Write of size 8 at addr ffff88803a22bb08 by task syz-executor.3/21763 CPU: 1 PID: 21763 Comm: syz-executor.3 Not tainted 6.4.0-rc2-syzkaller-00338-ge2065b8c1b01 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:351 [inline] print_report+0x163/0x540 mm/kasan/report.c:462 kasan_report+0x176/0x1b0 mm/kasan/report.c:572 mini_qdisc_pair_swap+0x1b1/0x1d0 net/sched/sch_generic.c:1573 tcf_chain_head_change_item net/sched/cls_api.c:495 [inline] tcf_chain0_head_change net/sched/cls_api.c:509 [inline] tcf_chain_tp_insert net/sched/cls_api.c:1827 [inline] tcf_chain_tp_insert_unique+0xb63/0xd50 net/sched/cls_api.c:1876 tc_new_tfilter+0x1684/0x1af0 net/sched/cls_api.c:2267 rtnetlink_rcv_msg+0x873/0xf40 net/core/rtnetlink.c:6386 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2546 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x7c3/0x990 net/netlink/af_netlink.c:1365 netlink_sendmsg+0xa2a/0xd60 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg net/socket.c:747 [inline] ____sys_sendmsg+0x58f/0x890 net/socket.c:2503 ___sys_sendmsg net/socket.c:2557 [inline] __sys_sendmmsg+0x3af/0x730 net/socket.c:2643 __do_sys_sendmmsg net/socket.c:2672 [inline] __se_sys_sendmmsg net/socket.c:2669 [inline] __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2669 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f708328c169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7084055168 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f70833abf80 RCX: 00007f708328c169 RDX: 040000000000009f RSI: 00000000200002c0 RDI: 0000000000000006 RBP: 00007f70832e7ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdbe91154f R14: 00007f7084055300 R15: 0000000000022000 Allocated by task 21766: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc_node+0xb8/0x230 mm/slab_common.c:973 kmalloc_node include/linux/slab.h:579 [inline] kzalloc_node include/linux/slab.h:691 [inline] qdisc_alloc+0x95/0x950 net/sched/sch_generic.c:938 qdisc_create+0x189/0x10e0 net/sched/sch_api.c:1246 tc_modify_qdisc+0xab0/0x1ca0 rtnetlink_rcv_msg+0x825/0xf40 net/core/rtnetlink.c:6395 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2546 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x7c3/0x990 net/netlink/af_netlink.c:1365 netlink_sendmsg+0xa2a/0xd60 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg net/socket.c:747 [inline] ____sys_sendmsg+0x58f/0x890 net/socket.c:2503 ___sys_sendmsg net/socket.c:2557 [inline] __sys_sendmmsg+0x3af/0x730 net/socket.c:2643 __do_sys_sendmmsg net/socket.c:2672 [inline] __se_sys_sendmmsg net/socket.c:2669 [inline] __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2669 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 21767: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:521 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0x264/0x3c0 mm/slub.c:3799 rcu_do_batch kernel/rcu/tree.c:2115 [inline] rcu_core+0x9d7/0x15f0 kernel/rcu/tree.c:2377 __do_softirq+0x2ab/0x908 kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491 __call_rcu_common kernel/rcu/tree.c:2627 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:2741 qdisc_put_unlocked+0x59/0x90 net/sched/sch_generic.c:1097 tcf_block_release net/sched/cls_api.c:1362 [inline] tc_new_tfilter+0x1ff/0x1af0 net/sched/cls_api.c:2332 rtnetlink_rcv_msg+0x873/0xf40 net/core/rtnetlink.c:6386 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2546 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x7c3/0x990 net/netlink/af_netlink.c:1365 netlink_sendmsg+0xa2a/0xd60 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg net/socket.c:747 [inline] ____sys_sendmsg+0x58f/0x890 net/socket.c:2503 ___sys_sendmsg net/socket.c:2557 [inline] __sys_sendmmsg+0x3af/0x730 net/socket.c:2643 __do_sys_sendmmsg net/socket.c:2672 [inline] __se_sys_sendmmsg net/socket.c:2669 [inline] __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2669 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491 kvfree_call_rcu+0x109/0x8d0 kernel/rcu/tree.c:3332 cgroup_migrate_finish+0x1bb/0x380 kernel/cgroup/cgroup.c:2723 cgroup_attach_task+0x61e/0x8e0 kernel/cgroup/cgroup.c:2922 cgroup_attach_task_all+0xa1/0xe0 kernel/cgroup/cgroup-v1.c:70 kvm_vm_worker_thread+0xd4/0x520 arch/x86/kvm/../../../virt/kvm/kvm_main.c:6103 kthread+0x2b8/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88803a22b800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 776 bytes inside of freed 1024-byte region [ffff88803a22b800, ffff88803a22bc00) The buggy address belongs to the physical page: page:ffffea0000e88a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3a228 head:ffffea0000e88a00 order:3 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 ffff888012441dc0 ffffea00007bd800 dead000000000003 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5097, tgid 5097 (kworker/0:7), ts 197281783015, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0x321c/0x33a0 mm/page_alloc.c:3502 __alloc_pages+0x255/0x670 mm/page_alloc.c:4768 alloc_slab_page+0x6a/0x160 mm/slub.c:1851 allocate_slab mm/slub.c:1998 [inline] new_slab+0x84/0x2f0 mm/slub.c:2051 ___slab_alloc+0xa85/0x10a0 mm/slub.c:3192 __slab_alloc mm/slub.c:3291 [inline] __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] __kmem_cache_alloc_node+0x1b8/0x290 mm/slub.c:3490 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc_node_track_caller+0xa5/0x230 mm/slab_common.c:986 kmalloc_reserve+0xfe/0x240 net/core/skbuff.c:585 __alloc_skb+0x1b1/0x420 net/core/skbuff.c:654 alloc_skb include/linux/skbuff.h:1288 [inline] nlmsg_new include/net/netlink.h:1003 [inline] inet6_rt_notify+0xe0/0x290 net/ipv6/route.c:6165 fib6_add_rt2node net/ipv6/ip6_fib.c:1251 [inline] fib6_add+0x1dc4/0x3d40 net/ipv6/ip6_fib.c:1477 __ip6_ins_rt net/ipv6/route.c:1301 [inline] ip6_route_add+0x88/0x120 net/ipv6/route.c:3839 addrconf_add_mroute net/ipv6/addrconf.c:2489 [inline] addrconf_add_dev+0x354/0x500 net/ipv6/addrconf.c:2507 addrconf_dev_config net/ipv6/addrconf.c:3382 [inline] addrconf_init_auto_addrs+0x85f/0xe90 net/ipv6/addrconf.c:3469 addrconf_notify+0xb59/0xfe0 net/ipv6/addrconf.c:3642 page_owner free stack trace missing Memory state around the buggy address: ffff88803a22ba00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803a22ba80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88803a22bb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803a22bb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803a22bc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================