==================================================================
BUG: KASAN: use-after-free in __nft_trace_packet+0x137/0x150 net/netfilter/nf_tables_core.c:30
Read of size 2 at addr ffff888061cd06c0 by task syz-executor/4883
CPU: 1 PID: 4883 Comm: syz-executor Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
print_address_description+0x63/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
__nft_trace_packet+0x137/0x150 net/netfilter/nf_tables_core.c:30
nft_trace_verdict net/netfilter/nf_tables_core.c:110 [inline]
nft_do_chain+0x1453/0x16b0 net/netfilter/nf_tables_core.c:256
nft_do_chain_inet+0x3f8/0x680 net/netfilter/nft_chain_filter.c:161
nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline]
nf_hook_slow+0xae/0x1e0 net/netfilter/core.c:584
nf_hook include/linux/netfilter.h:257 [inline]
NF_HOOK+0x26b/0x410 include/linux/netfilter.h:300
NF_HOOK+0x364/0x410 include/linux/netfilter.h:302
__netif_receive_skb_one_core net/core/dev.c:5485 [inline]
__netif_receive_skb+0x1c6/0x530 net/core/dev.c:5599
process_backlog+0x363/0x7f0 net/core/dev.c:6476
__napi_poll+0xc7/0x440 net/core/dev.c:7035
napi_poll net/core/dev.c:7102 [inline]
net_rx_action+0x617/0xda0 net/core/dev.c:7192
handle_softirqs+0x3a7/0x930 kernel/softirq.c:558
__do_softirq kernel/softirq.c:592 [inline]
invoke_softirq kernel/softirq.c:432 [inline]
__irq_exit_rcu+0x157/0x240 kernel/softirq.c:641
irq_exit_rcu+0x5/0x20 kernel/softirq.c:653
sysvec_call_function_single+0x8e/0xb0 arch/x86/kernel/smp.c:243
asm_sysvec_call_function_single+0x16/0x20 arch/x86/include/asm/idtentry.h:646
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:202
Code: 51 67 f6 ff 90 53 48 89 fb 48 83 c7 18 48 8b 74 24 08 e8 4e ed 24 f7 48 89 df e8 26 41 26 f7 e8 f1 f4 48 f7 fb bf 01 00 00 00 06 87 19 f7 65 8b 05 87 89 c4 75 85 c0 74 02 5b c3 e8 54 a6 c2
RSP: 0018:ffffc900033e77a8 EFLAGS: 00000286
RAX: afdfa3c1c4150200 RBX: ffff888073578990 RCX: ffffffff96868f03
RDX: dffffc0000000000 RSI: ffffffff8a8b2b00 RDI: 0000000000000001
RBP: ffff888073578988 R08: ffffffff8186db50 R09: ffffed100e6af133
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffea0001caa080
R13: 00fff00000080017 R14: ffffea0001caa088 R15: ffffea0001caa080
spin_unlock_irq include/linux/spinlock.h:413 [inline]
delete_from_page_cache+0x12e/0x190 mm/filemap.c:267
truncate_inode_page+0x8d/0xb0 mm/truncate.c:219
shmem_undo_range+0x535/0x1b50 mm/shmem.c:960
shmem_truncate_range mm/shmem.c:1063 [inline]
shmem_evict_inode+0x21b/0xa00 mm/shmem.c:1145
evict+0x529/0x930 fs/inode.c:622
__dentry_kill+0x436/0x650 fs/dcache.c:586
dentry_kill+0xbb/0x290
dput+0xd8/0x1a0 fs/dcache.c:893
__fput+0x636/0x8e0 fs/file_table.c:288
task_work_run+0x129/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307
do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f2a57d5d327
Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007fff949fa448 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f2a57dce134 RCX: 00007f2a57d5d327
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007fff949fa500
RBP: 00007fff949fa500 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 00007fff949fb580
R13: 00007f2a57dce134 R14: 0000000000027782 R15: 00007fff949fb5c0
Allocated by task 4883:
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+0x8e/0xc0 mm/kasan/common.c:467
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3220 [inline]
kmem_cache_alloc_node+0x121/0x2c0 mm/slub.c:3256
__alloc_skb+0xdd/0x590 net/core/skbuff.c:415
alloc_skb include/linux/skbuff.h:1167 [inline]
synproxy_send_client_synack+0x1b6/0xf20 net/netfilter/nf_synproxy_core.c:482
nft_synproxy_eval_v4+0x3c6/0x610 net/netfilter/nft_synproxy.c:59
nft_synproxy_do_eval+0x359/0xa60 net/netfilter/nft_synproxy.c:141
expr_call_ops_eval net/netfilter/nf_tables_core.c:198 [inline]
nft_do_chain+0x467/0x16b0 net/netfilter/nf_tables_core.c:238
nft_do_chain_inet+0x3f8/0x680 net/netfilter/nft_chain_filter.c:161
nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline]
nf_hook_slow+0xae/0x1e0 net/netfilter/core.c:584
nf_hook include/linux/netfilter.h:257 [inline]
NF_HOOK+0x26b/0x410 include/linux/netfilter.h:300
NF_HOOK+0x364/0x410 include/linux/netfilter.h:302
__netif_receive_skb_one_core net/core/dev.c:5485 [inline]
__netif_receive_skb+0x1c6/0x530 net/core/dev.c:5599
process_backlog+0x363/0x7f0 net/core/dev.c:6476
__napi_poll+0xc7/0x440 net/core/dev.c:7035
napi_poll net/core/dev.c:7102 [inline]
net_rx_action+0x617/0xda0 net/core/dev.c:7192
handle_softirqs+0x3a7/0x930 kernel/softirq.c:558
__do_softirq kernel/softirq.c:592 [inline]
invoke_softirq kernel/softirq.c:432 [inline]
__irq_exit_rcu+0x157/0x240 kernel/softirq.c:641
irq_exit_rcu+0x5/0x20 kernel/softirq.c:653
sysvec_call_function_single+0x8e/0xb0 arch/x86/kernel/smp.c:243
asm_sysvec_call_function_single+0x16/0x20 arch/x86/include/asm/idtentry.h:646
Freed by task 4883:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x80 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kmem_cache_free+0x91/0x1f0 mm/slub.c:3515
nft_synproxy_eval_v4+0x3ce/0x610 net/netfilter/nft_synproxy.c:60
nft_synproxy_do_eval+0x359/0xa60 net/netfilter/nft_synproxy.c:141
expr_call_ops_eval net/netfilter/nf_tables_core.c:198 [inline]
nft_do_chain+0x467/0x16b0 net/netfilter/nf_tables_core.c:238
nft_do_chain_inet+0x3f8/0x680 net/netfilter/nft_chain_filter.c:161
nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline]
nf_hook_slow+0xae/0x1e0 net/netfilter/core.c:584
nf_hook include/linux/netfilter.h:257 [inline]
NF_HOOK+0x26b/0x410 include/linux/netfilter.h:300
NF_HOOK+0x364/0x410 include/linux/netfilter.h:302
__netif_receive_skb_one_core net/core/dev.c:5485 [inline]
__netif_receive_skb+0x1c6/0x530 net/core/dev.c:5599
process_backlog+0x363/0x7f0 net/core/dev.c:6476
__napi_poll+0xc7/0x440 net/core/dev.c:7035
napi_poll net/core/dev.c:7102 [inline]
net_rx_action+0x617/0xda0 net/core/dev.c:7192
handle_softirqs+0x3a7/0x930 kernel/softirq.c:558
__do_softirq kernel/softirq.c:592 [inline]
invoke_softirq kernel/softirq.c:432 [inline]
__irq_exit_rcu+0x157/0x240 kernel/softirq.c:641
irq_exit_rcu+0x5/0x20 kernel/softirq.c:653
sysvec_call_function_single+0x8e/0xb0 arch/x86/kernel/smp.c:243
asm_sysvec_call_function_single+0x16/0x20 arch/x86/include/asm/idtentry.h:646
The buggy address belongs to the object at ffff888061cd0640
which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 128 bytes inside of
232-byte region [ffff888061cd0640, ffff888061cd0728)
The buggy address belongs to the page:
page:ffffea0001873400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x61cd0
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 0000000300000001 ffff88801bfe4140
raw: 0000000000000000 00000000000c000c 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 3590, ts 58841728026, free_ts 16126106670
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159
__alloc_pages+0x272/0x700 mm/page_alloc.c:5423
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xbb/0x4b0 mm/slub.c:1975
___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
kmem_cache_alloc_node+0x1ba/0x2c0 mm/slub.c:3256
__alloc_skb+0xdd/0x590 net/core/skbuff.c:415
alloc_skb include/linux/skbuff.h:1167 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
inet6_ifinfo_notify+0x69/0x110 net/ipv6/addrconf.c:6069
addrconf_notify+0xc0d/0xf30 net/ipv6/addrconf.c:3685
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
call_netdevice_notifiers_info net/core/dev.c:2018 [inline]
netdev_state_change+0x1a3/0x250 net/core/dev.c:1409
linkwatch_do_dev+0x10c/0x160 net/core/link_watch.c:167
__linkwatch_run_queue+0x4ca/0x7f0 net/core/link_watch.c:213
linkwatch_event+0x48/0x50 net/core/link_watch.c:252
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
process_scheduled_works kernel/workqueue.c:2373 [inline]
worker_thread+0xdcf/0x1280 kernel/workqueue.c:2459
kthread+0x3f6/0x4f0 kernel/kthread.c:334
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+0xc34/0xcf0 mm/page_alloc.c:3317
free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396
free_contig_range+0x95/0xf0 mm/page_alloc.c:9342
destroy_args+0xfe/0x980 mm/debug_vm_pgtable.c:1018
debug_vm_pgtable+0x40d/0x470 mm/debug_vm_pgtable.c:1331
do_one_initcall+0x22b/0x7a0 init/main.c:1302
do_initcall_level+0x157/0x210 init/main.c:1375
do_initcalls+0x49/0x90 init/main.c:1391
kernel_init_freeable+0x425/0x5c0 init/main.c:1615
kernel_init+0x19/0x290 init/main.c:1506
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Memory state around the buggy address:
ffff888061cd0580: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
ffff888061cd0600: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
>ffff888061cd0680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888061cd0700: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
ffff888061cd0780: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 51 push %rcx
1: 67 f6 ff addr32 idiv %bh
4: 90 nop
5: 53 push %rbx
6: 48 89 fb mov %rdi,%rbx
9: 48 83 c7 18 add $0x18,%rdi
d: 48 8b 74 24 08 mov 0x8(%rsp),%rsi
12: e8 4e ed 24 f7 call 0xf724ed65
17: 48 89 df mov %rbx,%rdi
1a: e8 26 41 26 f7 call 0xf7264145
1f: e8 f1 f4 48 f7 call 0xf748f515
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 06 87 19 f7 call 0xf7198735 <-- trapping instruction
2f: 65 8b 05 87 89 c4 75 mov %gs:0x75c48987(%rip),%eax # 0x75c489bd
36: 85 c0 test %eax,%eax
38: 74 02 je 0x3c
3a: 5b pop %rbx
3b: c3 ret
3c: e8 .byte 0xe8
3d: 54 push %rsp
3e: a6 cmpsb %es:(%rdi),%ds:(%rsi)
3f: c2 .byte 0xc2