==================================================================
BUG: KASAN: use-after-free in smc_fback_error_report+0x6d/0x90 net/smc/af_smc.c:664
Read of size 8 at addr ffff888029009aa8 by task syz-executor.2/3621
CPU: 1 PID: 3621 Comm: syz-executor.2 Not tainted 5.17.0-rc5-syzkaller-00011-g5c1ee569660d #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+0x1dc/0x2d8 lib/dump_stack.c:106
print_address_description+0x65/0x3a0 mm/kasan/report.c:255
__kasan_report mm/kasan/report.c:442 [inline]
kasan_report+0x19a/0x1f0 mm/kasan/report.c:459
smc_fback_error_report+0x6d/0x90 net/smc/af_smc.c:664
sk_error_report+0x3b/0xb0 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+0x11b7/0x2e00 net/ipv4/tcp_timer.c:512
tcp_write_timer_handler+0x236/0xa90 net/ipv4/tcp_timer.c:622
tcp_write_timer+0x176/0x290 net/ipv4/tcp_timer.c:642
call_timer_fn+0xf5/0x210 kernel/time/timer.c:1421
expire_timers kernel/time/timer.c:1466 [inline]
__run_timers+0x71a/0x910 kernel/time/timer.c:1734
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1747
__do_softirq+0x392/0x7a3 kernel/softirq.c:558
__irq_exit_rcu+0xec/0x170 kernel/softirq.c:637
irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1097
asm_sysvec_apic_timer_interrupt+0x12/0x20
RIP: 0010:finish_lock_switch+0x1c5/0x350 kernel/sched/core.c:4756
Code: be ff ff ff ff e8 0b c8 bf 08 85 c0 74 37 4d 85 e4 75 58 0f 1f 44 00 00 4c 89 ff e8 15 73 c2 08 e8 60 15 2f 00 fb 48 83 c4 10 <5b> 41 5c 41 5d 41 5e 41 5f 5d c3 0f 0b 4d 85 e4 0f 85 4a ff ff ff
RSP: 0018:ffffc9000204fa48 EFLAGS: 00000286
RAX: 7ae2dc014f132800 RBX: 1ffff11017367448 RCX: ffffffff90bf3803
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffff8880b9b3a240 R08: ffffffff818c6960 R09: ffffed10173672f1
R10: ffffed10173672f1 R11: 0000000000000000 R12: 0000000000000000
R13: ffff8880b9b3a4d8 R14: dffffc0000000000 R15: ffff8880b9b39780
finish_task_switch+0x140/0x630 kernel/sched/core.c:4873
context_switch kernel/sched/core.c:4998 [inline]
__schedule+0x92e/0x1080 kernel/sched/core.c:6304
schedule+0x12b/0x1f0 kernel/sched/core.c:6377
freezable_schedule include/linux/freezer.h:172 [inline]
do_nanosleep+0x1ca/0x7a0 kernel/time/hrtimer.c:2044
hrtimer_nanosleep+0x24d/0x490 kernel/time/hrtimer.c:2097
__do_sys_clock_nanosleep kernel/time/posix-timers.c:1267 [inline]
__se_sys_clock_nanosleep+0x308/0x390 kernel/time/posix-timers.c:1245
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f4b4a471d81
Code: 24 0c 89 3c 24 48 89 4c 24 18 e8 aa e7 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 8b 74 24 0c 8b 3c 24 b8 e6 00 00 00 0f 05 <44> 89 c7 48 89 04 24 e8 e3 e7 ff ff 48 8b 04 24 eb 97 66 2e 0f 1f
RSP: 002b:00007ffec87bc080 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6
RAX: ffffffffffffffda RBX: 00000000000057aa RCX: 00007f4b4a471d81
RDX: 00007ffec87bc0c0 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007ffec87bc14c R08: 0000000000000000 R09: 0000000000000010
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000032
R13: 000000000024158d R14: 0000000000000002 R15: 00007ffec87bc1b0
Allocated by task 8896:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:436 [inline]
__kasan_slab_alloc+0xb2/0xe0 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_node mm/slub.c:3230 [inline]
slab_alloc mm/slub.c:3238 [inline]
kmem_cache_alloc+0x1c9/0x310 mm/slub.c:3243
getname_flags+0xba/0x650 fs/namei.c:138
do_sys_openat2+0xd2/0x500 fs/open.c:1208
do_sys_open fs/open.c:1230 [inline]
__do_sys_openat fs/open.c:1246 [inline]
__se_sys_openat fs/open.c:1241 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1241
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
Freed by task 8896:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4c/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x126/0x180 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:236 [inline]
slab_free_hook mm/slub.c:1728 [inline]
slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1754
slab_free mm/slub.c:3509 [inline]
kmem_cache_free+0xb6/0x1c0 mm/slub.c:3526
do_sys_openat2+0x431/0x500 fs/open.c:1223
do_sys_open fs/open.c:1230 [inline]
__do_sys_openat fs/open.c:1246 [inline]
__se_sys_openat fs/open.c:1241 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1241
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
The buggy address belongs to the object at ffff888029009100
which belongs to the cache names_cache of size 4096
The buggy address is located 2472 bytes inside of
4096-byte region [ffff888029009100, ffff88802900a100)
The buggy address belongs to the page:
page:ffffea0000a40200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x29008
head:ffffea0000a40200 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888140007500
raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 8892, ts 2356489911925, free_ts 2356418041513
prep_new_page mm/page_alloc.c:2434 [inline]
get_page_from_freelist+0x729/0x9e0 mm/page_alloc.c:4165
__alloc_pages+0x255/0x580 mm/page_alloc.c:5389
alloc_slab_page mm/slub.c:1799 [inline]
allocate_slab+0xce/0x3f0 mm/slub.c:1944
new_slab mm/slub.c:2004 [inline]
___slab_alloc+0x3fe/0xc30 mm/slub.c:3018
__slab_alloc mm/slub.c:3105 [inline]
slab_alloc_node mm/slub.c:3196 [inline]
slab_alloc mm/slub.c:3238 [inline]
kmem_cache_alloc+0x276/0x310 mm/slub.c:3243
getname_flags+0xba/0x650 fs/namei.c:138
getname fs/namei.c:217 [inline]
__do_sys_symlink fs/namei.c:4350 [inline]
__se_sys_symlink fs/namei.c:4348 [inline]
__x64_sys_symlink+0x6a/0x90 fs/namei.c:4348
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 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+0xd1c/0xe00 mm/page_alloc.c:1404
free_unref_page_prepare mm/page_alloc.c:3325 [inline]
free_unref_page+0x7d/0x580 mm/page_alloc.c:3404
do_slab_free mm/slub.c:3497 [inline]
___cache_free+0x107/0x160 mm/slub.c:3516
qlist_free_all mm/kasan/quarantine.c:176 [inline]
kasan_quarantine_reduce+0x169/0x1f0 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xe0 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_node mm/slub.c:3230 [inline]
slab_alloc mm/slub.c:3238 [inline]
kmem_cache_alloc+0x1c9/0x310 mm/slub.c:3243
getname_flags+0xba/0x650 fs/namei.c:138
user_path_at_empty+0x2a/0x1a0 fs/namei.c:2850
user_path_at include/linux/namei.h:57 [inline]
vfs_statx+0x10f/0x3b0 fs/stat.c:221
vfs_fstatat fs/stat.c:243 [inline]
vfs_lstat include/linux/fs.h:3287 [inline]
__do_sys_newlstat fs/stat.c:398 [inline]
__se_sys_newlstat+0xba/0x750 fs/stat.c:392
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
Memory state around the buggy address:
ffff888029009980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888029009a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888029009a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888029009b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888029009b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: be ff ff ff ff mov $0xffffffff,%esi
5: e8 0b c8 bf 08 callq 0x8bfc815
a: 85 c0 test %eax,%eax
c: 74 37 je 0x45
e: 4d 85 e4 test %r12,%r12
11: 75 58 jne 0x6b
13: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
18: 4c 89 ff mov %r15,%rdi
1b: e8 15 73 c2 08 callq 0x8c27335
20: e8 60 15 2f 00 callq 0x2f1585
25: fb sti
26: 48 83 c4 10 add $0x10,%rsp
* 2a: 5b pop %rbx <-- trapping instruction
2b: 41 5c pop %r12
2d: 41 5d pop %r13
2f: 41 5e pop %r14
31: 41 5f pop %r15
33: 5d pop %rbp
34: c3 retq
35: 0f 0b ud2
37: 4d 85 e4 test %r12,%r12
3a: 0f 85 4a ff ff ff jne 0xffffff8a