[moderation] [serial?] KASAN: slab-out-of-bounds Write in do_con_write (3)

1 view
Skip to first unread message

syzbot

unread,
4:51 PM (6 hours ago) 4:51 PM
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: f0b9d8eb98df Merge tag 'nfsd-6.19-3' of git://git.kernel.o..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=136c21fc580000
kernel config: https://syzkaller.appspot.com/x/.config?x=8bfa57a8c0ab3aa8
dashboard link: https://syzkaller.appspot.com/bug?extid=40b8f12e9f9080f59990
compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
CC: [gre...@linuxfoundation.org jiri...@kernel.org linux-...@vger.kernel.org linux-...@vger.kernel.org]

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/94d39666cdc9/disk-f0b9d8eb.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/39eb74ba5915/vmlinux-f0b9d8eb.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f27141501510/bzImage-f0b9d8eb.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+40b8f1...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-out-of-bounds in vc_con_write_normal drivers/tty/vt/vt.c:3141 [inline]
BUG: KASAN: slab-out-of-bounds in do_con_write+0x383e/0x8280 drivers/tty/vt/vt.c:3232
Write of size 2 at addr ffff88807b18bf60 by task syz.0.798/9997

CPU: 0 UID: 0 PID: 9997 Comm: syz.0.798 Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xcd/0x630 mm/kasan/report.c:482
kasan_report+0xe0/0x110 mm/kasan/report.c:595
vc_con_write_normal drivers/tty/vt/vt.c:3141 [inline]
do_con_write+0x383e/0x8280 drivers/tty/vt/vt.c:3232
con_write+0x23/0xb0 drivers/tty/vt/vt.c:3565
process_output_block drivers/tty/n_tty.c:557 [inline]
n_tty_write+0x434/0x1280 drivers/tty/n_tty.c:2366
iterate_tty_write drivers/tty/tty_io.c:1006 [inline]
file_tty_write.constprop.0+0x503/0x9b0 drivers/tty/tty_io.c:1081
tty_write drivers/tty/tty_io.c:1102 [inline]
redirected_tty_write drivers/tty/tty_io.c:1125 [inline]
redirected_tty_write+0xd4/0x120 drivers/tty/tty_io.c:1105
new_sync_write fs/read_write.c:593 [inline]
vfs_write+0x7d3/0x11d0 fs/read_write.c:686
ksys_write+0x12a/0x250 fs/read_write.c:738
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8d7878f7c9
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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f8d79635038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f8d789e5fa0 RCX: 00007f8d7878f7c9
RDX: 0000000000000930 RSI: 0000200000001bc0 RDI: 0000000000000008
RBP: 00007f8d78813f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f8d789e6038 R14: 00007f8d789e5fa0 R15: 00007ffd9a1c1028
</TASK>

Allocated by task 7778:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__do_kmalloc_node mm/slub.c:5657 [inline]
__kmalloc_node_track_caller_noprof+0x353/0x930 mm/slub.c:5764
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:608
__alloc_skb+0x186/0x410 net/core/skbuff.c:690
alloc_skb include/linux/skbuff.h:1383 [inline]
nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:818 [inline]
nsim_dev_trap_report drivers/net/netdevsim/dev.c:875 [inline]
nsim_dev_trap_report_work+0x2b1/0xcf0 drivers/net/netdevsim/dev.c:921
process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257
process_scheduled_works kernel/workqueue.c:3340 [inline]
worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421
kthread+0x3c5/0x780 kernel/kthread.c:463
ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246

Freed by task 7778:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:253 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2540 [inline]
slab_free mm/slub.c:6670 [inline]
kfree+0x2f8/0x6e0 mm/slub.c:6878
skb_kfree_head net/core/skbuff.c:1068 [inline]
skb_free_head+0x114/0x210 net/core/skbuff.c:1080
skb_release_data+0x795/0x9e0 net/core/skbuff.c:1107
skb_release_all net/core/skbuff.c:1182 [inline]
__kfree_skb net/core/skbuff.c:1196 [inline]
consume_skb net/core/skbuff.c:1428 [inline]
consume_skb+0xbf/0x100 net/core/skbuff.c:1422
nsim_dev_trap_report drivers/net/netdevsim/dev.c:891 [inline]
nsim_dev_trap_report_work+0x8bd/0xcf0 drivers/net/netdevsim/dev.c:921
process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257
process_scheduled_works kernel/workqueue.c:3340 [inline]
worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421
kthread+0x3c5/0x780 kernel/kthread.c:463
ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246

The buggy address belongs to the object at ffff88807b18a000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 3936 bytes to the right of
allocated 4096-byte region [ffff88807b18a000, ffff88807b18b000)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7b188
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88813ff27140 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88813ff27140 dead000000000100 dead000000000122
head: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000
head: 00fff00000000003 ffffea0001ec6201 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 8382, tgid 8380 (syz.4.497), ts 247140300203, free_ts 247128604100
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1857
prep_new_page mm/page_alloc.c:1865 [inline]
get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3915
__alloc_frozen_pages_noprof+0x25f/0x2430 mm/page_alloc.c:5210
alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486
alloc_slab_page mm/slub.c:3075 [inline]
allocate_slab mm/slub.c:3248 [inline]
new_slab+0x2c3/0x430 mm/slub.c:3302
___slab_alloc+0xe18/0x1c90 mm/slub.c:4656
__slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4779
__slab_alloc_node mm/slub.c:4855 [inline]
slab_alloc_node mm/slub.c:5251 [inline]
__kmalloc_cache_noprof+0x485/0x800 mm/slub.c:5771
kmalloc_noprof include/linux/slab.h:957 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
io_ring_ctx_alloc io_uring/io_uring.c:290 [inline]
io_uring_create io_uring/io_uring.c:3591 [inline]
io_uring_setup+0x1c4/0x1f80 io_uring/io_uring.c:3723
__do_sys_io_uring_setup io_uring/io_uring.c:3757 [inline]
__se_sys_io_uring_setup io_uring/io_uring.c:3748 [inline]
__x64_sys_io_uring_setup+0xc2/0x170 io_uring/io_uring.c:3748
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 8359 tgid 8351 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1406 [inline]
__free_frozen_pages+0x7df/0x1170 mm/page_alloc.c:2943
can_pernet_exit+0x60/0xf0 net/can/af_can.c:831
ops_exit_list net/core/net_namespace.c:199 [inline]
ops_undo_list+0x2ee/0xab0 net/core/net_namespace.c:252
setup_net+0x1ff/0x3a0 net/core/net_namespace.c:462
copy_net_ns+0x351/0x7c0 net/core/net_namespace.c:581
create_new_namespaces+0x3ea/0xab0 kernel/nsproxy.c:130
unshare_nsproxy_namespaces+0xc0/0x1f0 kernel/nsproxy.c:226
ksys_unshare+0x45b/0xa40 kernel/fork.c:3171
__do_sys_unshare kernel/fork.c:3242 [inline]
__se_sys_unshare kernel/fork.c:3240 [inline]
__x64_sys_unshare+0x31/0x40 kernel/fork.c:3240
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
ffff88807b18be00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807b18be80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88807b18bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88807b18bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807b18c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages