================================================================== 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 ffff8880600b718c by task syz.3.1697/13079 CPU: 2 UID: 0 PID: 13079 Comm: syz.3.1697 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:2709 ___sys_sendmsg+0x190/0x1e0 net/socket.c:2763 __sys_sendmsg+0x160/0x210 net/socket.c:2795 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:0xf7fc4fec Code: Unable to access opcode bytes at 0xf7fc4fc2. RSP: 002b:00000000f548650c 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 5727: 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:5334 [inline] __kvmalloc_node_noprof+0x351/0x970 mm/slub.c:6905 xt_alloc_table_info+0x44/0xa0 net/netfilter/x_tables.c:1286 compat_do_replace+0x19b/0x500 net/ipv4/netfilter/ip_tables.c:1511 do_ip6t_set_ctl+0x2cb/0xbe0 net/ipv6/netfilter/ip6_tables.c:1640 nf_setsockopt+0x8d/0xf0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x135/0x170 net/ipv6/ipv6_sockglue.c:970 tcp_setsockopt+0xa7/0x100 net/ipv4/tcp.c:4179 do_sock_setsockopt+0xf3/0x1d0 net/socket.c:2393 __sys_setsockopt+0x119/0x190 net/socket.c:2418 __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 5727: 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:2677 [inline] slab_free mm/slub.c:6377 [inline] kfree+0x22b/0x6c0 mm/slub.c:6692 translate_compat_table+0x1368/0x17e0 net/ipv6/netfilter/ip6_tables.c:1479 compat_do_replace+0x279/0x500 net/ipv4/netfilter/ip_tables.c:1522 do_ip6t_set_ctl+0x2cb/0xbe0 net/ipv6/netfilter/ip6_tables.c:1640 nf_setsockopt+0x8d/0xf0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x135/0x170 net/ipv6/ipv6_sockglue.c:970 tcp_setsockopt+0xa7/0x100 net/ipv4/tcp.c:4179 do_sock_setsockopt+0xf3/0x1d0 net/socket.c:2393 __sys_setsockopt+0x119/0x190 net/socket.c:2418 __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 ffff8880600b7000 which belongs to the cache kmalloc-cg-1k of size 1024 The buggy address is located 396 bytes inside of freed 1024-byte region [ffff8880600b7000, ffff8880600b7400) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8880600b1000 pfn:0x600b0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff8880600b0411 flags: 0x4fff00000000240(workingset|head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000240 ffff88801c04c000 ffffea000139b410 ffffea0001b20610 raw: ffff8880600b1000 000008000010000e 00000000f5000000 ffff8880600b0411 head: 04fff00000000240 ffff88801c04c000 ffffea000139b410 ffffea0001b20610 head: ffff8880600b1000 000008000010000e 00000000f5000000 ffff8880600b0411 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5734, tgid 5734 (syz-executor), ts 52522052209, free_ts 52521347719 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0xf46/0x3500 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x299/0x2dc0 mm/page_alloc.c:5304 alloc_slab_page mm/slub.c:3266 [inline] allocate_slab mm/slub.c:3380 [inline] new_slab+0xa2/0x660 mm/slub.c:3426 refill_objects+0xe3/0x410 mm/slub.c:7310 refill_sheaf mm/slub.c:2804 [inline] __pcs_replace_empty_main+0x372/0x680 mm/slub.c:4675 alloc_from_pcs mm/slub.c:4773 [inline] slab_alloc_node mm/slub.c:4905 [inline] __do_kmalloc_node mm/slub.c:5333 [inline] __kvmalloc_node_noprof+0x791/0x970 mm/slub.c:6905 xt_alloc_table_info+0x44/0xa0 net/netfilter/x_tables.c:1286 compat_do_replace+0x19b/0x500 net/ipv4/netfilter/ip_tables.c:1511 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:2393 __sys_setsockopt+0x119/0x190 net/socket.c:2418 __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 page last free pid 5734 tgid 5734 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0x79f/0x1090 mm/page_alloc.c:2950 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:4584 [inline] slab_alloc_node mm/slub.c:4917 [inline] __do_kmalloc_node mm/slub.c:5333 [inline] __kvmalloc_node_noprof+0x2ed/0x970 mm/slub.c:6905 xt_alloc_table_info+0x44/0xa0 net/netfilter/x_tables.c:1286 compat_do_replace+0x19b/0x500 net/ipv4/netfilter/ip_tables.c:1511 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:2393 __sys_setsockopt+0x119/0x190 net/socket.c:2418 __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 Memory state around the buggy address: ffff8880600b7080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880600b7100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880600b7180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880600b7200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880600b7280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================