==================================================================
BUG: KASAN: use-after-free in smc_fback_error_report+0x96/0xa0 net/smc/af_smc.c:664
Read of size 8 at addr ffff88807a4e3028 by task kworker/u4:17/27311
CPU: 0 PID: 27311 Comm: kworker/u4:17 Not tainted 5.17.0-rc5-syzkaller-00006-g917bbdb107f8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: bat_events batadv_nc_worker
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/0x336 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_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+0x67c/0xa30 kernel/time/timer.c:1734
__run_timers kernel/time/timer.c:1715 [inline]
run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747
__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:lock_release+0x28/0x720 kernel/locking/lockdep.c:5647
Code: 00 00 48 b8 00 00 00 00 00 fc ff df 41 57 41 56 41 55 41 54 49 89 fc 55 53 48 81 ec 90 00 00 00 48 8d 6c 24 10 48 89 74 24 08 <48> c7 44 24 10 b3 8a b5 41 48 c1 ed 03 48 c7 44 24 18 60 aa 39 8b
RSP: 0018:ffffc9000fa87bd0 EFLAGS: 00000282
RAX: dffffc0000000000 RBX: 0000000000000001 RCX: 0000000000000000
RDX: ffff88804cdc0000 RSI: ffffffff88e964e9 RDI: ffffffff8bb845e0
RBP: ffffc9000fa87be0 R08: 0000000000000000 R09: 0000000000000001
R10: ffffffff88e964e1 R11: 0000000000000000 R12: ffffffff8bb845e0
R13: 0000000000000000 R14: dffffc0000000000 R15: 00000000000001b6
rcu_lock_release include/linux/rcupdate.h:273 [inline]
rcu_read_unlock include/linux/rcupdate.h:727 [inline]
batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:412 [inline]
batadv_nc_worker+0x86b/0xfa0 net/batman-adv/network-coding.c:719
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 5199:
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+0x90/0xc0 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+0x271/0x4b0 mm/slub.c:3243
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/0x4d0 fs/open.c:1208
__do_sys_openat2 fs/open.c:1271 [inline]
__se_sys_openat2 fs/open.c:1249 [inline]
__x64_sys_openat2+0x202/0x320 fs/open.c:1249
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 5199:
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+0x126/0x160 mm/kasan/common.c:328
kasan_slab_free include/linux/kasan.h:236 [inline]
slab_free_hook mm/slub.c:1728 [inline]
slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754
slab_free mm/slub.c:3509 [inline]
kmem_cache_free+0xd7/0x370 mm/slub.c:3526
putname fs/namei.c:270 [inline]
putname+0xfe/0x140 fs/namei.c:256
do_sys_openat2+0x153/0x4d0 fs/open.c:1223
__do_sys_openat2 fs/open.c:1271 [inline]
__se_sys_openat2 fs/open.c:1249 [inline]
__x64_sys_openat2+0x202/0x320 fs/open.c:1249
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 ffff88807a4e2200
which belongs to the cache names_cache of size 4096
The buggy address is located 3624 bytes inside of
4096-byte region [ffff88807a4e2200, ffff88807a4e3200)
The buggy address belongs to the page:
page:ffffea0001e93800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a4e0
head:ffffea0001e93800 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff8881400063c0
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 5199, ts 2435492282947, free_ts 2435403878191
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+0x1aa/0x310 mm/mempolicy.c:2271
alloc_slab_page mm/slub.c:1799 [inline]
allocate_slab+0x27f/0x3c0 mm/slub.c:1944
new_slab mm/slub.c:2004 [inline]
___slab_alloc+0xbe1/0x12b0 mm/slub.c:3018
__slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105
slab_alloc_node mm/slub.c:3196 [inline]
slab_alloc mm/slub.c:3238 [inline]
kmem_cache_alloc+0x3cb/0x4b0 mm/slub.c:3243
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/0x4d0 fs/open.c:1208
__do_sys_openat2 fs/open.c:1271 [inline]
__se_sys_openat2 fs/open.c:1249 [inline]
__x64_sys_openat2+0x202/0x320 fs/open.c:1249
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
__unfreeze_partials+0x320/0x340 mm/slub.c:2536
qlink_free mm/kasan/quarantine.c:157 [inline]
qlist_free_all+0x6d/0x160 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0xa2/0xc0 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]
__kmalloc+0x256/0x450 mm/slub.c:4420
kmalloc include/linux/slab.h:586 [inline]
kzalloc include/linux/slab.h:715 [inline]
tomoyo_encode2.part.0+0xe9/0x3a0 security/tomoyo/realpath.c:45
tomoyo_encode2 security/tomoyo/realpath.c:31 [inline]
tomoyo_encode+0x28/0x50 security/tomoyo/realpath.c:80
tomoyo_path_perm+0x368/0x400 security/tomoyo/file.c:831
tomoyo_path_symlink+0x94/0xe0 security/tomoyo/tomoyo.c:199
security_path_symlink+0xdf/0x150 security/security.c:1168
do_symlinkat+0x106/0x2e0 fs/namei.c:4323
__do_sys_symlink fs/namei.c:4350 [inline]
__se_sys_symlink fs/namei.c:4348 [inline]
__x64_sys_symlink+0x75/0x90 fs/namei.c:4348
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:
ffff88807a4e2f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807a4e2f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807a4e3000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807a4e3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807a4e3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 00 00 add %al,(%rax)
2: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
9: fc ff df
c: 41 57 push %r15
e: 41 56 push %r14
10: 41 55 push %r13
12: 41 54 push %r12
14: 49 89 fc mov %rdi,%r12
17: 55 push %rbp
18: 53 push %rbx
19: 48 81 ec 90 00 00 00 sub $0x90,%rsp
20: 48 8d 6c 24 10 lea 0x10(%rsp),%rbp
25: 48 89 74 24 08 mov %rsi,0x8(%rsp)
* 2a: 48 c7 44 24 10 b3 8a movq $0x41b58ab3,0x10(%rsp) <-- trapping instruction
31: b5 41
33: 48 c1 ed 03 shr $0x3,%rbp
37: 48 c7 44 24 18 60 aa movq $0xffffffff8b39aa60,0x18(%rsp)
3e: 39 8b