[v5.15] KASAN: use-after-free Read in tty_write_room (4)

6 views
Skip to first unread message

syzbot

unread,
Jul 4, 2025, 12:13:35 AMJul 4
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3dea0e7f549e Linux 5.15.186
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16d7f770580000
kernel config: https://syzkaller.appspot.com/x/.config?x=fe91feccd8127a59
dashboard link: https://syzkaller.appspot.com/bug?extid=1d6919f93241262dc4b0
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e8db6cfea7ea/disk-3dea0e7f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/eeb133c8268e/vmlinux-3dea0e7f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9478525201a1/Image-3dea0e7f.gz.xz

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

ieee802154 phy0 wpan0: encryption failed: -22
ieee802154 phy1 wpan1: encryption failed: -22
==================================================================
BUG: KASAN: use-after-free in tty_write_room+0x3c/0x8c drivers/tty/tty_ioctl.c:78
Read of size 8 at addr ffff0000c1680018 by task aoe_tx0/2056

CPU: 0 PID: 2056 Comm: aoe_tx0 Not tainted 5.15.186-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call trace:
dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
print_address_description+0x78/0x30c mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xec/0x15c mm/kasan/report.c:451
__asan_report_load8_noabort+0x44/0x50 mm/kasan/report_generic.c:309
tty_write_room+0x3c/0x8c drivers/tty/tty_ioctl.c:78
handle_tx+0x12c/0x644 drivers/net/caif/caif_serial.c:226
caif_xmit+0x10c/0x160 drivers/net/caif/caif_serial.c:282
__netdev_start_xmit include/linux/netdevice.h:5027 [inline]
netdev_start_xmit include/linux/netdevice.h:5041 [inline]
xmit_one net/core/dev.c:3649 [inline]
dev_hard_start_xmit+0x2a8/0x87c net/core/dev.c:3665
__dev_queue_xmit+0x12d8/0x2800 net/core/dev.c:4288
dev_queue_xmit+0x24/0x34 net/core/dev.c:4321
tx+0x94/0x1cc drivers/block/aoe/aoenet.c:63
kthread+0x160/0x330 drivers/block/aoe/aoecmd.c:1238
kthread+0x374/0x454 kernel/kthread.c:334
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:855

Allocated by task 4515:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc mm/kasan/common.c:513 [inline]
__kasan_kmalloc+0xb0/0xf0 mm/kasan/common.c:522
kasan_kmalloc include/linux/kasan.h:264 [inline]
kmem_cache_alloc_trace+0x274/0x3fc mm/slub.c:3247
kmalloc include/linux/slab.h:604 [inline]
kzalloc include/linux/slab.h:735 [inline]
alloc_tty_struct+0xb4/0x684 drivers/tty/tty_io.c:3127
tty_init_dev+0x60/0x41c drivers/tty/tty_io.c:1424
tty_open_by_driver drivers/tty/tty_io.c:2100 [inline]
tty_open+0x6f4/0xba8 drivers/tty/tty_io.c:2148
chrdev_open+0x26c/0x4f0 fs/char_dev.c:414
do_dentry_open+0x760/0xebc fs/open.c:826
vfs_open+0x7c/0x90 fs/open.c:956
do_open fs/namei.c:3608 [inline]
path_openat+0x1f80/0x26e4 fs/namei.c:3742
do_filp_open+0x164/0x330 fs/namei.c:3769
do_sys_openat2+0x128/0x3d8 fs/open.c:1253
do_sys_open fs/open.c:1269 [inline]
__do_sys_openat fs/open.c:1285 [inline]
__se_sys_openat fs/open.c:1280 [inline]
__arm64_sys_openat+0x120/0x154 fs/open.c:1280
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Freed by task 4095:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4c/0x84 mm/kasan/common.c:46
kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360
____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:374
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0x128/0x1e8 mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kfree+0x170/0x40c mm/slub.c:4559
free_tty_struct drivers/tty/tty_io.c:175 [inline]
release_one_tty+0x244/0x29c drivers/tty/tty_io.c:1558
process_one_work+0x79c/0x1140 kernel/workqueue.c:2310
worker_thread+0x8f4/0x101c kernel/workqueue.c:2457
kthread+0x374/0x454 kernel/kthread.c:334
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:855

Last potentially related work creation:
kasan_save_stack+0x38/0x68 mm/kasan/common.c:38
kasan_record_aux_stack+0xcc/0x114 mm/kasan/generic.c:348
insert_work+0x64/0x388 kernel/workqueue.c:1366
__queue_work+0xb30/0x1054 kernel/workqueue.c:1532
queue_work_on+0xc4/0x17c kernel/workqueue.c:1559
queue_work include/linux/workqueue.h:512 [inline]
schedule_work include/linux/workqueue.h:573 [inline]
queue_release_one_tty drivers/tty/tty_io.c:1569 [inline]
kref_put include/linux/kref.h:65 [inline]
tty_kref_put+0x150/0x1d0 drivers/tty/tty_io.c:1583
release_tty+0x3e8/0x4a4 drivers/tty/tty_io.c:1620
tty_release_struct+0xb4/0xd4 drivers/tty/tty_io.c:1719
tty_release+0xa9c/0x132c drivers/tty/tty_io.c:1880
__fput+0x1c0/0x7f8 fs/file_table.c:311
____fput+0x20/0x30 fs/file_table.c:339
task_work_run+0x12c/0x1e0 kernel/task_work.c:188
exit_task_work include/linux/task_work.h:33 [inline]
do_exit+0x684/0x1f58 kernel/exit.c:883
do_group_exit+0x100/0x268 kernel/exit.c:997
get_signal+0x73c/0x1340 kernel/signal.c:2900
do_signal arch/arm64/kernel/signal.c:893 [inline]
do_notify_resume+0x35c/0x3128 arch/arm64/kernel/signal.c:946
prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline]
el0_svc+0xf0/0x1e0 arch/arm64/kernel/entry-common.c:609
el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

The buggy address belongs to the object at ffff0000c1680000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 24 bytes inside of
2048-byte region [ffff0000c1680000, ffff0000c1680800)
The buggy address belongs to the page:
page:00000000001c36ac refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000c1687000 pfn:0x101680
head:00000000001c36ac order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 fffffc000368e608 fffffc0003581c08 ffff0000c0002900
raw: ffff0000c1687000 0000000000080004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000c167ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff0000c167ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000c1680000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000c1680080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000c1680100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
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

syzbot

unread,
Dec 16, 2025, 4:38:20 PM (2 days ago) Dec 16
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages