==================================================================
BUG: KASAN: use-after-free in smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:782
Read of size 8 at addr ffff888072ace5a8 by task syz-executor.2/13727
CPU: 1 PID: 13727 Comm: syz-executor.2 Not tainted 5.18.0-rc4-syzkaller-00064-g8f4dd16603ce #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
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+0xeb/0x467 mm/kasan/report.c:313
print_report mm/kasan/report.c:429 [inline]
kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491
smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:782
sk_error_report+0x35/0x310 net/core/sock.c:340
tcp_write_err net/ipv4/tcp_timer.c:71 [inline]
tcp_probe_timer net/ipv4/tcp_timer.c:395 [inline]
tcp_write_timer_handler+0x437/0xbc0 net/ipv4/tcp_timer.c:626
tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:642
call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421
expire_timers kernel/time/timer.c:1466 [inline]
__run_timers.part.0+0x679/0xa80 kernel/time/timer.c:1737
__run_timers kernel/time/timer.c:1715 [inline]
run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1750
__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:645
RIP: 0010:finish_task_switch.isra.0+0x323/0xb80 kernel/sched/core.c:4953
Code: e3 95 18 08 85 c0 75 02 0f 0b 48 85 db 0f 85 25 01 00 00 4c 89 f7 e8 fc f7 ff ff e8 67 c7 2d 00 fb 65 48 8b 1c 25 00 70 02 00 <48> 8d bb 80 15 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1
RSP: 0018:ffffc90013977528 EFLAGS: 00000202
RAX: 000000000000e267 RBX: ffff88807d88e0c0 RCX: 1ffffffff20139b6
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc90013977570 R08: 0000000000000001 R09: ffffffff9005b9af
R10: 0000000000000001 R11: 0000000000000001 R12: dffffc0000000000
R13: ffff88807b0da200 R14: ffff8880b9d3a080 R15: 0000000000000000
context_switch kernel/sched/core.c:5076 [inline]
__schedule+0xaa2/0x4cc0 kernel/sched/core.c:6388
preempt_schedule_common+0x45/0xc0 kernel/sched/core.c:6553
preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:35
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
_raw_spin_unlock_irqrestore+0x57/0x70 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:404 [inline]
__wake_up_common_lock+0xde/0x130 kernel/sched/wait.c:139
__unix_dgram_recvmsg+0x2cd/0xb80 net/unix/af_unix.c:2418
unix_dgram_recvmsg+0xca/0xf0 net/unix/af_unix.c:2489
sock_recvmsg_nosec net/socket.c:948 [inline]
____sys_recvmsg+0x521/0x5f0 net/socket.c:2630
___sys_recvmsg+0x127/0x200 net/socket.c:2674
do_recvmmsg+0x24d/0x6d0 net/socket.c:2768
__sys_recvmmsg net/socket.c:2847 [inline]
__do_sys_recvmmsg net/socket.c:2870 [inline]
__se_sys_recvmmsg net/socket.c:2863 [inline]
__x64_sys_recvmmsg+0x20b/0x260 net/socket.c:2863
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
RIP: 0033:0x7f7fdf4890e9
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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f7fe0616168 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 00007f7fdf59c030 RCX: 00007f7fdf4890e9
RDX: 0000000000010106 RSI: 00000000200000c0 RDI: 0000000000000003
RBP: 00007f7fdf4e308d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffb3d7d1ef R14: 00007f7fe0616300 R15: 0000000000022000
Allocated by task 13404:
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:224 [inline]
slab_post_alloc_hook mm/slab.h:749 [inline]
slab_alloc mm/slab.c:3316 [inline]
__kmem_cache_alloc_lru mm/slab.c:3493 [inline]
kmem_cache_alloc+0x265/0x560 mm/slab.c:3513
getname_flags.part.0+0x50/0x4f0 fs/namei.c:138
getname_flags+0x9a/0xe0 include/linux/audit.h:323
vfs_fstatat+0x73/0xb0 fs/stat.c:254
__do_sys_newfstatat+0x91/0x110 fs/stat.c:425
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 13404:
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+0x13d/0x180 mm/kasan/common.c:328
kasan_slab_free include/linux/kasan.h:200 [inline]
__cache_free mm/slab.c:3439 [inline]
kmem_cache_free.part.0+0xa9/0x240 mm/slab.c:3749
putname fs/namei.c:270 [inline]
putname+0xfe/0x140 fs/namei.c:256
vfs_fstatat+0x97/0xb0 fs/stat.c:256
__do_sys_newfstatat+0x91/0x110 fs/stat.c:425
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 ffff888072ace440
which belongs to the cache names_cache of size 4096
The buggy address is located 360 bytes inside of
4096-byte region [ffff888072ace440, ffff888072acf440)
The buggy address belongs to the physical page:
page:ffffea0001cab380 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x72ace
head:ffffea0001cab380 order:1 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea000087fe88 ffffea0001f15488 ffff8881400a3000
raw: 0000000000000000 ffff888072ace440 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 13404, tgid 13404 (udevd), ts 470720705678, free_ts 470171621100
prep_new_page mm/page_alloc.c:2441 [inline]
get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182
__alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408
__alloc_pages_node include/linux/gfp.h:587 [inline]
kmem_getpages mm/slab.c:1378 [inline]
cache_grow_begin+0x75/0x350 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:3309 [inline]
__kmem_cache_alloc_lru mm/slab.c:3493 [inline]
kmem_cache_alloc+0x450/0x560 mm/slab.c:3513
getname_flags.part.0+0x50/0x4f0 fs/namei.c:138
getname_flags+0x9a/0xe0 include/linux/audit.h:323
vfs_fstatat+0x73/0xb0 fs/stat.c:254
__do_sys_newfstatat+0x91/0x110 fs/stat.c:425
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:1356 [inline]
free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1406
free_unref_page_prepare mm/page_alloc.c:3328 [inline]
free_unref_page+0x19/0x6a0 mm/page_alloc.c:3423
slab_destroy mm/slab.c:1630 [inline]
slabs_destroy+0x89/0xc0 mm/slab.c:1650
cache_flusharray mm/slab.c:3411 [inline]
___cache_free+0x34e/0x670 mm/slab.c:3474
qlink_free mm/kasan/quarantine.c:157 [inline]
qlist_free_all+0x4f/0x1b0 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:224 [inline]
slab_post_alloc_hook mm/slab.h:749 [inline]
slab_alloc mm/slab.c:3316 [inline]
__kmem_cache_alloc_lru mm/slab.c:3493 [inline]
kmem_cache_alloc+0x265/0x560 mm/slab.c:3513
getname_flags.part.0+0x50/0x4f0 fs/namei.c:138
getname_flags include/linux/audit.h:323 [inline]
getname+0x8e/0xd0 fs/namei.c:217
do_sys_openat2+0xf5/0x4c0 fs/open.c:1207
do_sys_open fs/open.c:1229 [inline]
__do_sys_openat fs/open.c:1245 [inline]
__se_sys_openat fs/open.c:1240 [inline]
__x64_sys_openat+0x13f/0x1f0 fs/open.c:1240
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
Memory state around the buggy address:
ffff888072ace480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888072ace500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888072ace580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888072ace600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888072ace680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: e3 95 jrcxz 0xffffff97
2: 18 08 sbb %cl,(%rax)
4: 85 c0 test %eax,%eax
6: 75 02 jne 0xa
8: 0f 0b ud2
a: 48 85 db test %rbx,%rbx
d: 0f 85 25 01 00 00 jne 0x138
13: 4c 89 f7 mov %r14,%rdi
16: e8 fc f7 ff ff callq 0xfffff817
1b: e8 67 c7 2d 00 callq 0x2dc787
20: fb sti
21: 65 48 8b 1c 25 00 70 mov %gs:0x27000,%rbx
28: 02 00
* 2a: 48 8d bb 80 15 00 00 lea 0x1580(%rbx),%rdi <-- trapping instruction
31: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
38: fc ff df
3b: 48 89 fa mov %rdi,%rdx
3e: 48 rex.W
3f: c1 .byte 0xc1