==================================================================
BUG: KASAN: use-after-free in smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:664
Read of size 8 at addr ffff888032975168 by task kworker/u4:27/17420
CPU: 1 PID: 17420 Comm: kworker/u4:27 Not tainted 5.17.0-rc3-syzkaller-00334-gc5d714aa6dce #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: netns cleanup_net
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description.constprop.0.cold+0x8d/0x303 mm/kasan/report.c:255
__kasan_report mm/kasan/report.c:442 [inline]
kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:664
sk_error_report+0x35/0x310 net/core/sock.c:340
tcp_write_err net/ipv4/tcp_timer.c:71 [inline]
tcp_write_timeout net/ipv4/tcp_timer.c:276 [inline]
tcp_retransmit_timer+0x20c2/0x3320 net/ipv4/tcp_timer.c:512
tcp_ld_RTO_revert net/ipv4/tcp_ipv4.c:442 [inline]
tcp_ld_RTO_revert+0x4fa/0x630 net/ipv4/tcp_ipv4.c:408
tcp_v4_err+0x1581/0x1760 net/ipv4/tcp_ipv4.c:568
icmp_socket_deliver+0x1c1/0x360 net/ipv4/icmp.c:833
icmp_unreach+0x339/0xc40 net/ipv4/icmp.c:950
icmp_rcv+0xfab/0x1d40 net/ipv4/icmp.c:1261
ip_protocol_deliver_rcu+0xa3/0xf30 net/ipv4/ip_input.c:204
ip_local_deliver_finish+0x20a/0x370 net/ipv4/ip_input.c:231
NF_HOOK include/linux/netfilter.h:307 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
ip_local_deliver+0x1b3/0x200 net/ipv4/ip_input.c:252
dst_input include/net/dst.h:461 [inline]
ip_rcv_finish+0x1cb/0x2f0 net/ipv4/ip_input.c:429
NF_HOOK include/linux/netfilter.h:307 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
ip_rcv+0xaa/0xd0 net/ipv4/ip_input.c:540
__netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5351
__netif_receive_skb+0x24/0x1b0 net/core/dev.c:5465
process_backlog+0x2a5/0x6c0 net/core/dev.c:5797
__napi_poll+0xb3/0x6e0 net/core/dev.c:6365
napi_poll net/core/dev.c:6432 [inline]
net_rx_action+0x801/0xb40 net/core/dev.c:6519
__do_softirq+0x29b/0x9c2 kernel/softirq.c:558
invoke_softirq kernel/softirq.c:432 [inline]
__irq_exit_rcu+0x123/0x180 kernel/softirq.c:637
irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097
asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638
RIP: 0010:kfree+0x125/0x2b0 mm/slab.c:3796
Code: 0e 4c 89 ea 48 89 ee 4c 89 e7 e8 f6 f8 ff ff 48 85 db 0f 85 a6 00 00 00 9c 58 f6 c4 02 0f 85 72 01 00 00 48 85 db 74 01 fb 5b <5d> 41 5c 41 5d c3 65 8b 05 d6 89 43 7e 83 f8 07 0f 87 5f 01 00 00
RSP: 0018:ffffc900052ffbd8 EFLAGS: 00000206
RAX: 0000000000000006 RBX: ffff88803eb38400 RCX: 1ffffffff1ff999e
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff88804083ea00 R08: 0000000000000001 R09: ffffffff8ffc694f
R10: 0000000000000001 R11: 0000000000088078 R12: ffff888010c40500
R13: ffffffff88fb71e2 R14: dffffc0000000000 R15: fffffbfff1af4350
mpls_net_exit+0x72/0x2f0 net/mpls/af_mpls.c:2706
ops_exit_list+0xb0/0x170 net/core/net_namespace.c:168
cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:597
process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307
worker_thread+0x657/0x1110 kernel/workqueue.c:2454
kthread+0x2e9/0x3a0 kernel/kthread.c:377
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Allocated by task 2965:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:436 [inline]
__kasan_slab_alloc+0x85/0xb0 mm/kasan/common.c:469
kasan_slab_alloc include/linux/kasan.h:260 [inline]
slab_post_alloc_hook mm/slab.h:732 [inline]
slab_alloc mm/slab.c:3315 [inline]
kmem_cache_alloc+0x265/0x560 mm/slab.c:3499
getname_flags.part.0+0x50/0x4f0 fs/namei.c:138
getname_flags include/linux/audit.h:323 [inline]
getname fs/namei.c:217 [inline]
__do_sys_unlink fs/namei.c:4266 [inline]
__se_sys_unlink fs/namei.c:4264 [inline]
__x64_sys_unlink+0xb1/0x110 fs/namei.c:4264
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
Freed by task 2965:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
kasan_set_track+0x21/0x30 mm/kasan/common.c:45
kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370
____kasan_slab_free mm/kasan/common.c:366 [inline]
____kasan_slab_free+0xff/0x140 mm/kasan/common.c:328
kasan_slab_free include/linux/kasan.h:236 [inline]
__cache_free mm/slab.c:3437 [inline]
kmem_cache_free.part.0+0x91/0x200 mm/slab.c:3733
putname fs/namei.c:270 [inline]
putname+0xfe/0x140 fs/namei.c:256
do_unlinkat+0x11f/0x650 fs/namei.c:4241
__do_sys_unlink fs/namei.c:4266 [inline]
__se_sys_unlink fs/namei.c:4264 [inline]
__x64_sys_unlink+0xc6/0x110 fs/namei.c:4264
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
The buggy address belongs to the object at ffff8880329748c0
which belongs to the cache names_cache of size 4096
The buggy address is located 2216 bytes inside of
4096-byte region [ffff8880329748c0, ffff8880329758c0)
The buggy address belongs to the page:
page:ffffea0000ca5d00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x32974
head:ffffea0000ca5d00 order:1 compound_mapcount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0000989588 ffffea0001f11908 ffff88801150d600
raw: 0000000000000000 ffff8880329748c0 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0x3420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 2965, ts 1026695725836, free_ts 1025649742637
prep_new_page mm/page_alloc.c:2434 [inline]
get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165
__alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389
__alloc_pages_node include/linux/gfp.h:572 [inline]
kmem_getpages mm/slab.c:1378 [inline]
cache_grow_begin+0x75/0x390 mm/slab.c:2584
cache_alloc_refill+0x27f/0x380 mm/slab.c:2957
____cache_alloc mm/slab.c:3040 [inline]
____cache_alloc mm/slab.c:3023 [inline]
__do_cache_alloc mm/slab.c:3267 [inline]
slab_alloc mm/slab.c:3308 [inline]
kmem_cache_alloc+0x450/0x560 mm/slab.c:3499
getname_flags.part.0+0x50/0x4f0 fs/namei.c:138
getname_flags include/linux/audit.h:323 [inline]
getname fs/namei.c:217 [inline]
__do_sys_unlink fs/namei.c:4266 [inline]
__se_sys_unlink fs/namei.c:4264 [inline]
__x64_sys_unlink+0xb1/0x110 fs/namei.c:4264
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1352 [inline]
free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404
free_unref_page_prepare mm/page_alloc.c:3325 [inline]
free_unref_page+0x19/0x690 mm/page_alloc.c:3404
slab_destroy mm/slab.c:1630 [inline]
slabs_destroy+0x89/0xc0 mm/slab.c:1650
cache_flusharray mm/slab.c:3410 [inline]
___cache_free+0x303/0x600 mm/slab.c:3472
qlink_free mm/kasan/quarantine.c:157 [inline]
qlist_free_all+0x50/0x1a0 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:446
kasan_slab_alloc include/linux/kasan.h:260 [inline]
slab_post_alloc_hook mm/slab.h:732 [inline]
slab_alloc mm/slab.c:3315 [inline]
__do_kmalloc mm/slab.c:3692 [inline]
__kmalloc+0x27a/0x4d0 mm/slab.c:3703
kmalloc_array+0x42/0x70 include/linux/slab.h:621
kcalloc include/linux/slab.h:652 [inline]
iter_file_splice_write+0x13f/0xc10 fs/splice.c:628
do_splice_from fs/splice.c:767 [inline]
direct_splice_actor+0x110/0x180 fs/splice.c:936
splice_direct_to_actor+0x34b/0x8c0 fs/splice.c:891
do_splice_direct+0x1b3/0x280 fs/splice.c:979
do_sendfile+0xaf2/0x1250 fs/read_write.c:1245
__do_sys_sendfile64 fs/read_write.c:1304 [inline]
__se_sys_sendfile64 fs/read_write.c:1296 [inline]
__x64_sys_sendfile64+0x149/0x210 fs/read_write.c:1296
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
Memory state around the buggy address:
ffff888032975000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888032975080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888032975100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888032975180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888032975200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 4c 89 ea mov %r13,%rdx
3: 48 89 ee mov %rbp,%rsi
6: 4c 89 e7 mov %r12,%rdi
9: e8 f6 f8 ff ff callq 0xfffff904
e: 48 85 db test %rbx,%rbx
11: 0f 85 a6 00 00 00 jne 0xbd
17: 9c pushfq
18: 58 pop %rax
19: f6 c4 02 test $0x2,%ah
1c: 0f 85 72 01 00 00 jne 0x194
22: 48 85 db test %rbx,%rbx
25: 74 01 je 0x28
27: fb sti
28: 5b pop %rbx
* 29: 5d pop %rbp <-- trapping instruction
2a: 41 5c pop %r12
2c: 41 5d pop %r13
2e: c3 retq
2f: 65 8b 05 d6 89 43 7e mov %gs:0x7e4389d6(%rip),%eax # 0x7e438a0c
36: 83 f8 07 cmp $0x7,%eax
39: 0f 87 5f 01 00 00 ja 0x19e