================================================================== BUG: KASAN: use-after-free in read_pnet include/net/net_namespace.h:414 [inline] BUG: KASAN: use-after-free in dev_net include/linux/netdevice.h:2738 [inline] BUG: KASAN: use-after-free in nf_hook_entry_head+0x2fe/0x310 net/netfilter/core.c:319 Read of size 8 at addr ffff88802f1b8108 by task syz.6.1426/10868 CPU: 1 UID: 0 PID: 10868 Comm: syz.6.1426 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~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 read_pnet include/net/net_namespace.h:414 [inline] dev_net include/linux/netdevice.h:2738 [inline] nf_hook_entry_head+0x2fe/0x310 net/netfilter/core.c:319 __nf_unregister_net_hook+0x7e/0x660 net/netfilter/core.c:491 nf_unregister_net_hook+0xd5/0x110 net/netfilter/core.c:536 nft_unregister_flowtable_ops net/netfilter/nf_tables_api.c:8977 [inline] __nft_unregister_flowtable_net_hooks+0xfc/0x3f0 net/netfilter/nf_tables_api.c:8992 nft_unregister_flowtable_net_hooks net/netfilter/nf_tables_api.c:9004 [inline] nf_tables_commit+0x249d/0x8c40 net/netfilter/nf_tables_api.c:11163 nfnetlink_rcv_batch+0x115e/0x2350 net/netfilter/nfnetlink.c:576 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:649 [inline] nfnetlink_rcv+0x3c1/0x430 net/netfilter/nfnetlink.c:667 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x5aa/0x870 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x8c8/0xdd0 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] ____sys_sendmsg+0xa5d/0xc30 net/socket.c:2592 ___sys_sendmsg+0x134/0x1d0 net/socket.c:2646 __sys_sendmsg+0x16d/0x220 net/socket.c:2678 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f419b18f7c9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f419c048038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f419b3e5fa0 RCX: 00007f419b18f7c9 RDX: 0000000000000000 RSI: 0000200000000080 RDI: 0000000000000007 RBP: 00007f419b213f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f419b3e6038 R14: 00007f419b3e5fa0 R15: 00007ffcc9ac9688 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88802f1b9e00 pfn:0x2f1b8 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffffea00016d1488 ffffea0000d8b588 0000000000000000 raw: ffff88802f1b9e00 0000000000000001 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 10476, tgid 10473 (syz.6.1309), ts 172733148973, free_ts 175107670556 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1846 prep_new_page mm/page_alloc.c:1854 [inline] get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3915 __alloc_frozen_pages_noprof+0x25f/0x2430 mm/page_alloc.c:5210 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c3/0x430 mm/slub.c:3302 ___slab_alloc+0xe18/0x1c90 mm/slub.c:4656 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __do_kmalloc_node mm/slub.c:5656 [inline] __kmalloc_noprof+0x4fc/0x910 mm/slub.c:5669 kmalloc_noprof include/linux/slab.h:961 [inline] io_cache_alloc_new+0x45/0xf0 io_uring/alloc_cache.c:40 io_cache_alloc io_uring/alloc_cache.h:59 [inline] io_uring_alloc_async_data io_uring/io_uring.h:342 [inline] io_rw_alloc_async io_uring/rw.c:202 [inline] __io_prep_rw+0x21d/0x1060 io_uring/rw.c:261 io_prep_rw+0x76/0x2c0 io_uring/rw.c:321 io_prep_rwv io_uring/rw.c:343 [inline] io_prep_readv+0x20/0xa0 io_uring/rw.c:358 io_init_req io_uring/io_uring.c:2234 [inline] io_submit_sqe io_uring/io_uring.c:2281 [inline] io_submit_sqes+0xa14/0x28e0 io_uring/io_uring.c:2434 __do_sys_io_uring_enter+0xd6b/0x1630 io_uring/io_uring.c:3277 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 9076 tgid 9076 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7df/0x1170 mm/page_alloc.c:2943 discard_slab mm/slub.c:3346 [inline] __put_partials+0x130/0x170 mm/slub.c:3886 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4c/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:349 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] __do_kmalloc_node mm/slub.c:5656 [inline] __kmalloc_node_noprof+0x30d/0x930 mm/slub.c:5663 kmalloc_node_noprof include/linux/slab.h:987 [inline] __vmalloc_area_node mm/vmalloc.c:3842 [inline] __vmalloc_node_range_noprof+0x405/0x16b0 mm/vmalloc.c:4051 __vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:4111 alloc_counters net/ipv6/netfilter/ip6_tables.c:815 [inline] copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:837 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1039 [inline] do_ip6t_get_ctl+0x6b6/0xae0 net/ipv6/netfilter/ip6_tables.c:1677 nf_getsockopt+0x7c/0xe0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1f7/0x280 net/ipv6/ipv6_sockglue.c:1473 tcp_getsockopt+0xa1/0x100 net/ipv4/tcp.c:4834 do_sock_getsockopt+0x324/0x410 net/socket.c:2383 __sys_getsockopt+0x12f/0x260 net/socket.c:2412 __do_sys_getsockopt net/socket.c:2419 [inline] __se_sys_getsockopt net/socket.c:2416 [inline] __x64_sys_getsockopt+0xbd/0x160 net/socket.c:2416 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 Memory state around the buggy address: ffff88802f1b8000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802f1b8080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88802f1b8100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88802f1b8180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802f1b8200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================