================================================================== BUG: KASAN: slab-use-after-free in nla_put_napi_id net/core/netdev-genl.c:386 [inline] BUG: KASAN: slab-use-after-free in netdev_nl_queue_fill_one+0xf97/0x11f0 net/core/netdev-genl.c:494 Read of size 4 at addr ffff88807596098c by task syz.7.3751/24492 CPU: 3 UID: 0 PID: 24492 Comm: syz.7.3751 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 nla_put_napi_id net/core/netdev-genl.c:386 [inline] netdev_nl_queue_fill_one+0xf97/0x11f0 net/core/netdev-genl.c:494 netdev_nl_queue_dump_one+0x189/0x380 net/core/netdev-genl.c:603 netdev_nl_queue_get_dumpit+0x16c/0x510 net/core/netdev-genl.c:641 genl_dumpit+0x125/0x230 net/netlink/genetlink.c:1026 netlink_dump+0x532/0xd00 net/netlink/af_netlink.c:2331 __netlink_dump_start+0x6d6/0x990 net/netlink/af_netlink.c:2446 genl_family_rcv_msg_dumpit+0x1e2/0x2e0 net/netlink/genetlink.c:1075 genl_family_rcv_msg net/netlink/genetlink.c:1191 [inline] genl_rcv_msg+0x471/0x800 net/netlink/genetlink.c:1209 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2556 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:800 [inline] __sock_sendmsg net/socket.c:815 [inline] ____sys_sendmsg+0xa4d/0xbe0 net/socket.c:2713 ___sys_sendmsg+0x190/0x1e0 net/socket.c:2767 __sys_sendmsg+0x160/0x210 net/socket.c:2799 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf70befec Code: Unable to access opcode bytes at 0xf70befc2. RSP: 002b:00000000f54ad50c EFLAGS: 00000292 ORIG_RAX: 0000000000000172 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000080000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 15214: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5414 [inline] __kvmalloc_node_noprof+0x35b/0x9b0 mm/slub.c:7005 xt_alloc_table_info+0x44/0xa0 net/netfilter/x_tables.c:1286 translate_compat_table+0xa78/0x1750 net/ipv4/netfilter/ip_tables.c:1426 compat_do_replace+0x279/0x500 net/ipv4/netfilter/ip_tables.c:1522 do_ipt_set_ctl+0x2cb/0xbc0 net/ipv4/netfilter/ip_tables.c:1631 nf_setsockopt+0x8d/0xf0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0xcb/0xf0 net/ipv4/ip_sockglue.c:1424 tcp_setsockopt+0xa7/0x100 net/ipv4/tcp.c:4179 do_sock_setsockopt+0xf3/0x1d0 net/socket.c:2397 __sys_setsockopt+0x119/0x190 net/socket.c:2422 __do_compat_sys_socketcall net/compat.c:490 [inline] __se_compat_sys_socketcall net/compat.c:422 [inline] __ia32_compat_sys_socketcall+0x556/0x770 net/compat.c:422 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 15214: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2748 [inline] slab_free mm/slub.c:6499 [inline] kfree+0x22b/0x6d0 mm/slub.c:6792 __do_replace+0x71f/0x980 net/ipv4/netfilter/ip_tables.c:1082 compat_do_replace+0x31e/0x500 net/ipv4/netfilter/ip_tables.c:1526 do_ipt_set_ctl+0x2cb/0xbc0 net/ipv4/netfilter/ip_tables.c:1631 nf_setsockopt+0x8d/0xf0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0xcb/0xf0 net/ipv4/ip_sockglue.c:1424 tcp_setsockopt+0xa7/0x100 net/ipv4/tcp.c:4179 do_sock_setsockopt+0xf3/0x1d0 net/socket.c:2397 __sys_setsockopt+0x119/0x190 net/socket.c:2422 __do_compat_sys_socketcall net/compat.c:490 [inline] __se_compat_sys_socketcall net/compat.c:422 [inline] __ia32_compat_sys_socketcall+0x556/0x770 net/compat.c:422 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888075960800 which belongs to the cache kmalloc-cg-1k of size 1024 The buggy address is located 396 bytes inside of freed 1024-byte region [ffff888075960800, ffff888075960c00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888075965000 pfn:0x75960 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888075960411 flags: 0x4fff00000000240(workingset|head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000240 ffff88801c04c000 ffffea000173e410 ffffea0001399410 raw: ffff888075965000 0000000300100007 00000000f5000000 ffff888075960411 head: 04fff00000000240 ffff88801c04c000 ffffea000173e410 ffffea0001399410 head: ffff888075965000 0000000300100007 00000000f5000000 ffff888075960411 head: 04fff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 7071, tgid 7071 (syz-executor), ts 231781740797 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x110d/0x35b0 mm/page_alloc.c:3943 __alloc_frozen_pages_noprof+0x2eb/0x3300 mm/page_alloc.c:5436 alloc_slab_page mm/slub.c:3347 [inline] allocate_slab mm/slub.c:3462 [inline] new_slab+0xa9/0x6e0 mm/slub.c:3513 refill_objects+0xe3/0x410 mm/slub.c:7410 refill_sheaf mm/slub.c:2885 [inline] __pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774 alloc_from_pcs mm/slub.c:4850 [inline] slab_alloc_node mm/slub.c:4984 [inline] __do_kmalloc_node mm/slub.c:5413 [inline] __kvmalloc_node_noprof+0x7bb/0x9b0 mm/slub.c:7005 netif_alloc_netdev_queues net/core/dev.c:11291 [inline] alloc_netdev_mqs+0xb4e/0x15c0 net/core/dev.c:12187 rtnl_create_link+0xc13/0xf80 net/core/rtnetlink.c:3777 rtnl_newlink_create net/core/rtnetlink.c:3959 [inline] __rtnl_newlink net/core/rtnetlink.c:4098 [inline] rtnl_newlink+0x15bc/0x2620 net/core/rtnetlink.c:4215 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:7132 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2556 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:800 [inline] __sock_sendmsg net/socket.c:815 [inline] __sys_sendto+0x48b/0x4e0 net/socket.c:2281 __do_compat_sys_socketcall net/compat.c:474 [inline] __se_compat_sys_socketcall net/compat.c:422 [inline] __ia32_compat_sys_socketcall+0x59a/0x770 net/compat.c:422 page last free pid 5726 tgid 5726 ts 229586948929 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1418 [inline] __free_frozen_pages+0x79f/0x10f0 mm/page_alloc.c:2962 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4683 [inline] slab_alloc_node mm/slub.c:4996 [inline] kmem_cache_alloc_noprof+0x269/0x6a0 mm/slub.c:5010 mt_alloc_one lib/maple_tree.c:139 [inline] mas_alloc_nodes lib/maple_tree.c:1089 [inline] mas_preallocate+0x1105/0x14a0 lib/maple_tree.c:4961 vma_iter_prealloc mm/vma.h:636 [inline] __mmap_new_vma mm/vma.c:2619 [inline] __mmap_region+0x130a/0x30b0 mm/vma.c:2836 mmap_region+0x3db/0x6d0 mm/vma.c:2921 do_mmap+0x12c7/0x1c30 mm/mmap.c:573 vm_mmap_pgoff+0x28d/0x470 mm/util.c:581 ksys_mmap_pgoff+0xe4/0x610 mm/mmap.c:619 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Memory state around the buggy address: ffff888075960880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888075960900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888075960980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888075960a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888075960a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================