==================================================================
BUG: KASAN: use-after-free in __nft_trace_packet+0x135/0x150 net/netfilter/nf_tables_core.c:30
Read of size 2 at addr ffff8880613f66c0 by task syz.3.125/4972
CPU: 0 PID: 4972 Comm: syz.3.125 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
print_address_description+0x60/0x2d0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xdf/0x130 mm/kasan/report.c:451
__nft_trace_packet+0x135/0x150 net/netfilter/nf_tables_core.c:30
nft_trace_verdict net/netfilter/nf_tables_core.c:110 [inline]
nft_do_chain+0x120e/0x1420 net/netfilter/nf_tables_core.c:256
nft_do_chain_inet+0x22b/0x300 net/netfilter/nft_chain_filter.c:161
nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline]
nf_hook_slow+0xb9/0x200 net/netfilter/core.c:584
nf_hook include/linux/netfilter.h:257 [inline]
NF_HOOK+0x1cb/0x360 include/linux/netfilter.h:300
NF_HOOK+0x2d6/0x360 include/linux/netfilter.h:302
__netif_receive_skb_one_core net/core/dev.c:5525 [inline]
__netif_receive_skb+0xcc/0x290 net/core/dev.c:5639
process_backlog+0x364/0x780 net/core/dev.c:6516
__napi_poll+0xc0/0x430 net/core/dev.c:7075
napi_poll net/core/dev.c:7142 [inline]
net_rx_action+0x4a8/0x9c0 net/core/dev.c:7232
handle_softirqs+0x328/0x820 kernel/softirq.c:576
do_softirq+0x13b/0x200 kernel/softirq.c:477
__local_bh_enable_ip+0x174/0x1b0 kernel/softirq.c:401
rcu_read_unlock_bh include/linux/rcupdate.h:810 [inline]
ip6_finish_output2+0x110b/0x1500 net/ipv6/ip6_output.c:131
dst_output include/net/dst.h:452 [inline]
NF_HOOK include/linux/netfilter.h:302 [inline]
ip6_xmit+0x1054/0x1670 net/ipv6/ip6_output.c:338
inet6_csk_xmit+0x444/0x6d0 net/ipv6/inet6_connection_sock.c:135
__tcp_transmit_skb+0x1ced/0x31c0 net/ipv4/tcp_output.c:1404
tcp_transmit_skb net/ipv4/tcp_output.c:1422 [inline]
tcp_send_syn_data net/ipv4/tcp_output.c:3864 [inline]
tcp_connect+0x2d6e/0x4970 net/ipv4/tcp_output.c:3903
tcp_v6_connect+0x1136/0x1920 net/ipv6/tcp_ipv6.c:337
__inet_stream_connect+0x293/0xdf0 net/ipv4/af_inet.c:672
tcp_sendmsg_fastopen+0x38f/0x600 net/ipv4/tcp.c:1195
tcp_sendmsg_locked+0x3097/0x3590 net/ipv4/tcp.c:1237
tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1457
sock_sendmsg_nosec net/socket.c:706 [inline]
__sock_sendmsg net/socket.c:718 [inline]
__sys_sendto+0x423/0x580 net/socket.c:2073
__do_sys_sendto net/socket.c:2085 [inline]
__se_sys_sendto net/socket.c:2081 [inline]
__x64_sys_sendto+0xda/0xf0 net/socket.c:2081
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f808f561749
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:00007f808d7c8038 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00007f808f7b7fa0 RCX: 00007f808f561749
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000000000b
RBP: 00007f808f5e5f91 R08: 0000200000000140 R09: 000000000000001c
R10: 0000000020000045 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f808f7b8038 R14: 00007f808f7b7fa0 R15: 00007ffee6199c38
Allocated by task 4972:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
__kasan_slab_alloc+0x9c/0xd0 mm/kasan/common.c:467
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3225 [inline]
slab_alloc mm/slub.c:3233 [inline]
kmem_cache_alloc+0x100/0x290 mm/slub.c:3238
skb_clone+0x1bd/0x350 net/core/skbuff.c:1523
netem_enqueue+0x11ae/0x3720 net/sched/sch_netem.c:480
dev_qdisc_enqueue+0x48/0x210 net/core/dev.c:3852
__dev_xmit_skb net/core/dev.c:3936 [inline]
__dev_queue_xmit+0xd7e/0x2ed0 net/core/dev.c:4253
neigh_hh_output include/net/neighbour.h:493 [inline]
neigh_output include/net/neighbour.h:507 [inline]
ip6_finish_output2+0x1035/0x1500 net/ipv6/ip6_output.c:130
dst_output include/net/dst.h:452 [inline]
NF_HOOK include/linux/netfilter.h:302 [inline]
ip6_xmit+0x1054/0x1670 net/ipv6/ip6_output.c:338
inet6_csk_xmit+0x444/0x6d0 net/ipv6/inet6_connection_sock.c:135
__tcp_transmit_skb+0x1ced/0x31c0 net/ipv4/tcp_output.c:1404
tcp_transmit_skb net/ipv4/tcp_output.c:1422 [inline]
tcp_send_syn_data net/ipv4/tcp_output.c:3864 [inline]
tcp_connect+0x2d6e/0x4970 net/ipv4/tcp_output.c:3903
tcp_v6_connect+0x1136/0x1920 net/ipv6/tcp_ipv6.c:337
__inet_stream_connect+0x293/0xdf0 net/ipv4/af_inet.c:672
tcp_sendmsg_fastopen+0x38f/0x600 net/ipv4/tcp.c:1195
tcp_sendmsg_locked+0x3097/0x3590 net/ipv4/tcp.c:1237
tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1457
sock_sendmsg_nosec net/socket.c:706 [inline]
__sock_sendmsg net/socket.c:718 [inline]
__sys_sendto+0x423/0x580 net/socket.c:2073
__do_sys_sendto net/socket.c:2085 [inline]
__se_sys_sendto net/socket.c:2081 [inline]
__x64_sys_sendto+0xda/0xf0 net/socket.c:2081
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Freed by task 4972:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1710 [inline]
slab_free_freelist_hook+0xea/0x170 mm/slub.c:1736
slab_free mm/slub.c:3504 [inline]
kmem_cache_free+0x8f/0x210 mm/slub.c:3520
nft_synproxy_eval_v6+0x373/0x560 net/netfilter/nft_synproxy.c:91
nft_synproxy_do_eval+0x3d3/0x570 net/netfilter/nft_synproxy.c:145
expr_call_ops_eval net/netfilter/nf_tables_core.c:198 [inline]
nft_do_chain+0x3fc/0x1420 net/netfilter/nf_tables_core.c:238
nft_do_chain_inet+0x22b/0x300 net/netfilter/nft_chain_filter.c:161
nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline]
nf_hook_slow+0xb9/0x200 net/netfilter/core.c:584
nf_hook include/linux/netfilter.h:257 [inline]
NF_HOOK+0x1cb/0x360 include/linux/netfilter.h:300
NF_HOOK+0x2d6/0x360 include/linux/netfilter.h:302
__netif_receive_skb_one_core net/core/dev.c:5525 [inline]
__netif_receive_skb+0xcc/0x290 net/core/dev.c:5639
process_backlog+0x364/0x780 net/core/dev.c:6516
__napi_poll+0xc0/0x430 net/core/dev.c:7075
napi_poll net/core/dev.c:7142 [inline]
net_rx_action+0x4a8/0x9c0 net/core/dev.c:7232
handle_softirqs+0x328/0x820 kernel/softirq.c:576
do_softirq+0x13b/0x200 kernel/softirq.c:477
__local_bh_enable_ip+0x174/0x1b0 kernel/softirq.c:401
rcu_read_unlock_bh include/linux/rcupdate.h:810 [inline]
ip6_finish_output2+0x110b/0x1500 net/ipv6/ip6_output.c:131
dst_output include/net/dst.h:452 [inline]
NF_HOOK include/linux/netfilter.h:302 [inline]
ip6_xmit+0x1054/0x1670 net/ipv6/ip6_output.c:338
inet6_csk_xmit+0x444/0x6d0 net/ipv6/inet6_connection_sock.c:135
__tcp_transmit_skb+0x1ced/0x31c0 net/ipv4/tcp_output.c:1404
tcp_transmit_skb net/ipv4/tcp_output.c:1422 [inline]
tcp_send_syn_data net/ipv4/tcp_output.c:3864 [inline]
tcp_connect+0x2d6e/0x4970 net/ipv4/tcp_output.c:3903
tcp_v6_connect+0x1136/0x1920 net/ipv6/tcp_ipv6.c:337
__inet_stream_connect+0x293/0xdf0 net/ipv4/af_inet.c:672
tcp_sendmsg_fastopen+0x38f/0x600 net/ipv4/tcp.c:1195
tcp_sendmsg_locked+0x3097/0x3590 net/ipv4/tcp.c:1237
tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1457
sock_sendmsg_nosec net/socket.c:706 [inline]
__sock_sendmsg net/socket.c:718 [inline]
__sys_sendto+0x423/0x580 net/socket.c:2073
__do_sys_sendto net/socket.c:2085 [inline]
__se_sys_sendto net/socket.c:2081 [inline]
__x64_sys_sendto+0xda/0xf0 net/socket.c:2081
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
The buggy address belongs to the object at ffff8880613f6640
which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 128 bytes inside of
232-byte region [ffff8880613f6640, ffff8880613f6728)
The buggy address belongs to the page:
page:ffffea000184fd80 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880613f6dc0 pfn:0x613f6
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea000184a340 0000000a00000002 ffff88801b5e7140
raw: ffff8880613f6dc0 00000000800c0007 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 4195, ts 110340064943, free_ts 44848838485
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
__alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487
alloc_slab_page mm/slub.c:1780 [inline]
allocate_slab mm/slub.c:1917 [inline]
new_slab+0xc0/0x4b0 mm/slub.c:1980
___slab_alloc+0x81e/0xdf0 mm/slub.c:3013
__slab_alloc mm/slub.c:3100 [inline]
slab_alloc_node mm/slub.c:3191 [inline]
kmem_cache_alloc_node+0x1c3/0x2d0 mm/slub.c:3261
__alloc_skb+0xf4/0x750 net/core/skbuff.c:415
alloc_skb include/linux/skbuff.h:1162 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
rtmsg_ifinfo_build_skb+0x80/0x180 net/core/rtnetlink.c:3886
rtmsg_ifinfo_event net/core/rtnetlink.c:3922 [inline]
rtmsg_ifinfo+0x71/0x120 net/core/rtnetlink.c:3931
__dev_notify_flags+0xde/0x2d0 net/core/dev.c:8887
rtnl_configure_link+0x21f/0x320 net/core/rtnetlink.c:-1
__rtnl_newlink net/core/rtnetlink.c:3534 [inline]
rtnl_newlink+0x1377/0x17d0 net/core/rtnetlink.c:3574
rtnetlink_rcv_msg+0x7ff/0xe90 net/core/rtnetlink.c:5684
netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2507
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x774/0x920 net/netlink/af_netlink.c:1344
netlink_sendmsg+0x8ab/0xbc0 net/netlink/af_netlink.c:1918
sock_sendmsg_nosec net/socket.c:706 [inline]
__sock_sendmsg net/socket.c:718 [inline]
__sys_sendto+0x423/0x580 net/socket.c:2073
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
free_unref_page+0x94/0x280 mm/page_alloc.c:3396
free_contig_range+0x96/0xf0 mm/page_alloc.c:9406
destroy_args+0x100/0xa20 mm/debug_vm_pgtable.c:1018
debug_vm_pgtable+0x318/0x370 mm/debug_vm_pgtable.c:1336
do_one_initcall+0x1ee/0x680 init/main.c:1316
do_initcall_level+0x137/0x1f0 init/main.c:1389
do_initcalls+0x4b/0x90 init/main.c:1405
kernel_init_freeable+0x3ce/0x560 init/main.c:1629
kernel_init+0x19/0x1b0 init/main.c:1520
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Memory state around the buggy address:
ffff8880613f6580: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
ffff8880613f6600: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
>ffff8880613f6680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880613f6700: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
ffff8880613f6780: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================