==================================================================
BUG: KASAN: stack-out-of-bounds in user_mode arch/x86/include/asm/ptrace.h:136 [inline]
BUG: KASAN: stack-out-of-bounds in unwind_next_frame+0x17fc/0x1ef0 arch/x86/kernel/unwind_orc.c:455
Read of size 8 at addr ffffc900056afa50 by task syz-executor.1/14892
CPU: 0 PID: 14892 Comm: syz-executor.1 Not tainted 6.2.0-rc8-next-20230220-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:319
print_report mm/kasan/report.c:430 [inline]
kasan_report+0x11c/0x130 mm/kasan/report.c:536
user_mode arch/x86/include/asm/ptrace.h:136 [inline]
unwind_next_frame+0x17fc/0x1ef0 arch/x86/kernel/unwind_orc.c:455
arch_stack_walk+0x81/0xf0 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x90/0xc0 kernel/stacktrace.c:122
kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491
irq_work_queue_on+0xd6/0x1a0 kernel/irq_work.c:140
irq_work_single+0x1e4/0x260 kernel/irq_work.c:211
__flush_smp_call_function_queue+0x4a3/0xad0 kernel/smp.c:668
__sysvec_call_function_single+0xce/0x4f0 arch/x86/kernel/smp.c:248
sysvec_call_function_single+0x92/0xc0 arch/x86/kernel/smp.c:243
asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:653
RIP: 0010:__tcp_transmit_skb+0x1a1b/0x3820 net/ipv4/tcp_output.c:1257
Code: 84 24 70 01 00 00 65 48 2b 04 25 28 00 00 00 0f 85 a4 1a 00 00 48 81 c4 78 01 00 00 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 10 5c e6 f8 4d 8d 6c 24 58 48 b8 00 00 00 00 00 fc ff df 4c 89
RSP: 0018:ffffc900056af9c0 EFLAGS: 00000202
RAX: 0000000000000000 RBX: 0000000000000001 RCX: ffffffff889e2f9e
RDX: ffff88807f05ba80 RSI: 0000000000000000 RDI: 0000000000000005
RBP: ffff8880446f1980 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000094001 R12: ffff888021ab6f00
R13: 0000011e4f92e601 R14: 0000000000000820 R15: dffffc0000000000
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0046:__tcp_transmit_skb+0x0/0x3820 net/ipv4/tcp_output.c:1236
RSP: 8beed100:0000000041b58ab3 EFLAGS: ffffffff889eb701 ORIG_RAX: ffffffff8bfd0768
RAX: 0000000000000046 RBX: 0000011e29ea4641 RCX: 01006a11dacc00a9
RDX: 1ffff92000ad5f4c RSI: 0000000000000002 RDI: 0000000041b58ab3
RBP: 0000000000000000 R08: ffffffff8164e53d R09: 0000000000000003
R10: 0000000000000046 R11: 1ffff92000ad5f47 R12: ffff88807f05ba80
R13: ffffffff8c797740 R14: 0000000000000003 R15: 823d336c00000000
The buggy address belongs to stack of task syz-executor.1/14892
and is located at offset 24 in frame:
read_pnet include/net/net_namespace.h:383 [inline]
sock_net include/net/sock.h:649 [inline]
tcp_win_from_space include/net/tcp.h:1438 [inline]
tcp_adjust_rcv_ssthresh include/net/tcp.h:1465 [inline]
__tcp_transmit_skb+0x0/0x3820 net/ipv4/tcp_output.c:2975
This frame has 4 objects:
[32, 36) 'remaining'
[48, 52) 'size'
[64, 72) 'md5'
[96, 184) 'opts'
The buggy address belongs to the virtual mapping at
[ffffc900056a8000, ffffc900056b1000) created by:
kernel_clone+0xeb/0xa10 kernel/fork.c:2684
The buggy address belongs to the physical page:
page:ffffea0001e08840 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78221
memcg:ffff888029490982
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff ffff888029490982
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 14782, tgid 14782 (syz-executor.3), ts 1209378728131, free_ts 1208877861752
prep_new_page mm/page_alloc.c:2552 [inline]
get_page_from_freelist+0x11bb/0x2d50 mm/page_alloc.c:4339
__alloc_pages+0x1cb/0x5c0 mm/page_alloc.c:5605
alloc_pages+0x1aa/0x270 mm/mempolicy.c:2283
vm_area_alloc_pages mm/vmalloc.c:2942 [inline]
__vmalloc_area_node mm/vmalloc.c:3010 [inline]
__vmalloc_node_range+0xb8a/0x1300 mm/vmalloc.c:3180
alloc_thread_stack_node kernel/fork.c:311 [inline]
dup_task_struct kernel/fork.c:984 [inline]
copy_process+0x1320/0x76c0 kernel/fork.c:2100
kernel_clone+0xeb/0xa10 kernel/fork.c:2684
__do_sys_clone+0xba/0x100 kernel/fork.c:2825
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1453 [inline]
free_pcp_prepare+0x4de/0x930 mm/page_alloc.c:1503
free_unref_page_prepare mm/page_alloc.c:3401 [inline]
free_unref_page+0x1d/0x490 mm/page_alloc.c:3496
__unfreeze_partials+0x17c/0x1a0 mm/slub.c:2637
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x192/0x220 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x63/0x90 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:186 [inline]
slab_post_alloc_hook mm/slab.h:769 [inline]
slab_alloc_node mm/slub.c:3452 [inline]
__kmem_cache_alloc_node+0x17c/0x330 mm/slub.c:3491
__do_kmalloc_node mm/slab_common.c:966 [inline]
__kmalloc+0x4a/0xd0 mm/slab_common.c:980
kmalloc include/linux/slab.h:584 [inline]
kzalloc include/linux/slab.h:720 [inline]
tomoyo_encode2.part.0+0xe9/0x3a0 security/tomoyo/realpath.c:45
tomoyo_encode2 security/tomoyo/realpath.c:31 [inline]
tomoyo_encode+0x2c/0x50 security/tomoyo/realpath.c:80
tomoyo_mount_acl+0xe5/0x840 security/tomoyo/mount.c:97
tomoyo_mount_permission+0x163/0x410 security/tomoyo/mount.c:237
security_sb_mount+0x6a/0xc0 security/security.c:1007
path_mount+0x133/0x1e40 fs/namespace.c:3314
do_mount fs/namespace.c:3385 [inline]
__do_sys_mount fs/namespace.c:3594 [inline]
__se_sys_mount fs/namespace.c:3571 [inline]
__x64_sys_mount+0x283/0x300 fs/namespace.c:3571
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
Memory state around the buggy address:
ffffc900056af900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc900056af980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc900056afa00: 00 00 00 00 00 00 00 f1 f1 f1 f1 04 f2 04 f2 00
^
ffffc900056afa80: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 f3 f3
ffffc900056afb00: f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 84 24 70 test %ah,(%rax,%rsi,2)
3: 01 00 add %eax,(%rax)
5: 00 65 48 add %ah,0x48(%rbp)
8: 2b 04 25 28 00 00 00 sub 0x28,%eax
f: 0f 85 a4 1a 00 00 jne 0x1ab9
15: 48 81 c4 78 01 00 00 add $0x178,%rsp
1c: 44 89 e0 mov %r12d,%eax
1f: 5b pop %rbx
20: 5d pop %rbp
21: 41 5c pop %r12
23: 41 5d pop %r13
25: 41 5e pop %r14
27: 41 5f pop %r15
29: c3 retq
* 2a: e8 10 5c e6 f8 callq 0xf8e65c3f <-- trapping instruction
2f: 4d 8d 6c 24 58 lea 0x58(%r12),%r13
34: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
3b: fc ff df
3e: 4c rex.WR
3f: 89 .byte 0x89