Hello,
syzbot found the following issue on:
HEAD commit: 18f7fcd5e69a Linux 6.19-rc8
git tree: upstream
console output:
https://syzkaller.appspot.com/x/log.txt?x=1409825a580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=f1fac0919970b671
dashboard link:
https://syzkaller.appspot.com/bug?extid=69bff2c19454ab7c21a0
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
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 (non-bootable):
https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-18f7fcd5.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/c1940572c92e/vmlinux-18f7fcd5.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/09c4718cd47f/bzImage-18f7fcd5.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+69bff2...@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: slab-use-after-free in uart_write+0x9fd/0xb20 drivers/tty/serial/serial_core.c:612
Read of size 8 at addr ffff888056df35f8 by task aoe_tx0/1422
CPU: 0 UID: 0 PID: 1422 Comm: aoe_tx0 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x156/0x4c9 mm/kasan/report.c:482
kasan_report+0xdf/0x1a0 mm/kasan/report.c:595
uart_write+0x9fd/0xb20 drivers/tty/serial/serial_core.c:612
handle_tx+0x1ff/0x620 drivers/net/caif/caif_serial.c:222
__netdev_start_xmit include/linux/netdevice.h:5273 [inline]
netdev_start_xmit include/linux/netdevice.h:5282 [inline]
xmit_one net/core/dev.c:3866 [inline]
dev_hard_start_xmit+0x127/0x6c0 net/core/dev.c:3882
__dev_queue_xmit+0x6dd/0x46f0 net/core/dev.c:4832
dev_queue_xmit include/linux/netdevice.h:3381 [inline]
tx+0xc4/0x130 drivers/block/aoe/aoenet.c:62
kthread+0x1d8/0x3c0 drivers/block/aoe/aoecmd.c:1241
kthread+0x3b3/0x730 kernel/kthread.c:463
ret_from_fork+0x754/0xaf0 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
</TASK>
Allocated by task 6127:
kasan_save_stack+0x30/0x50 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
kmalloc_noprof include/linux/slab.h:957 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
alloc_tty_struct+0x96/0x8c0 drivers/tty/tty_io.c:3102
tty_init_dev.part.0+0x20/0x470 drivers/tty/tty_io.c:1400
tty_init_dev include/linux/err.h:78 [inline]
tty_open_by_driver drivers/tty/tty_io.c:2073 [inline]
tty_open+0xa63/0xfa0 drivers/tty/tty_io.c:2120
chrdev_open+0x234/0x6a0 fs/char_dev.c:414
do_dentry_open+0x73e/0x1570 fs/open.c:962
vfs_open+0x82/0x3f0 fs/open.c:1094
do_open fs/namei.c:4637 [inline]
path_openat+0x21dc/0x3120 fs/namei.c:4796
do_filp_open+0x1f7/0x420 fs/namei.c:4823
do_sys_openat2+0x12e/0x220 fs/open.c:1430
do_sys_open fs/open.c:1436 [inline]
__do_sys_openat fs/open.c:1452 [inline]
__se_sys_openat fs/open.c:1447 [inline]
__x64_sys_openat+0x12d/0x210 fs/open.c:1447
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xc9/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 53:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
kasan_save_free_info+0x3b/0x70 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:6674 [inline]
kfree+0x1c7/0x690 mm/slub.c:6882
process_one_work+0x9c2/0x1840 kernel/workqueue.c:3257
process_scheduled_works kernel/workqueue.c:3340 [inline]
worker_thread+0x5da/0xe40 kernel/workqueue.c:3421
kthread+0x3b3/0x730 kernel/kthread.c:463
ret_from_fork+0x754/0xaf0 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246
Last potentially related work creation:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556
insert_work+0x36/0x230 kernel/workqueue.c:2180
__queue_work+0x96f/0x10f0 kernel/workqueue.c:2335
queue_work_on+0x180/0x1e0 kernel/workqueue.c:2386
kref_put include/linux/kref.h:65 [inline]
tty_kref_put drivers/tty/tty_io.c:1557 [inline]
tty_kref_put drivers/tty/tty_io.c:1554 [inline]
release_tty+0x4f3/0x5f0 drivers/tty/tty_io.c:1593
tty_release_struct+0xb7/0xe0 drivers/tty/tty_io.c:1692
tty_release+0xd7a/0x1300 drivers/tty/tty_io.c:1852
__fput+0x3ff/0xb40 fs/file_table.c:468
task_work_run+0x150/0x240 kernel/task_work.c:233
exit_task_work include/linux/task_work.h:40 [inline]
do_exit+0x829/0x2a30 kernel/exit.c:971
do_group_exit+0xd5/0x2a0 kernel/exit.c:1112
get_signal+0x1ec7/0x21e0 kernel/signal.c:3034
arch_do_signal_or_restart+0x91/0x7a0 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:41 [inline]
exit_to_user_mode_loop+0x86/0x4b0 kernel/entry/common.c:75
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline]
do_syscall_64+0x4fe/0xf80 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888056df3000
which belongs to the cache kmalloc-cg-2k of size 2048
The buggy address is located 1528 bytes inside of
freed 2048-byte region [ffff888056df3000, ffff888056df3800)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x56df0
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88805609e981
anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801b84c140 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000080008 00000000f5000000 ffff88805609e981
head: 00fff00000000040 ffff88801b84c140 0000000000000000 dead000000000001
head: 0000000000000000 0000000000080008 00000000f5000000 ffff88805609e981
head: 00fff00000000003 ffffea00015b7c01 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 6032, tgid 6031 (syz.2.6), ts 65779837095, free_ts 0
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1884
prep_new_page mm/page_alloc.c:1892 [inline]
get_page_from_freelist+0xe3d/0x2e10 mm/page_alloc.c:3945
__alloc_frozen_pages_noprof+0x26c/0x2410 mm/page_alloc.c:5240
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+0x2c4/0x440 mm/slub.c:3302
___slab_alloc+0xda3/0x1ca0 mm/slub.c:4656
__slab_alloc.isra.0+0x63/0x110 mm/slub.c:4779
__slab_alloc_node mm/slub.c:4855 [inline]
slab_alloc_node mm/slub.c:5251 [inline]
__do_kmalloc_node mm/slub.c:5656 [inline]
__kmalloc_node_track_caller_noprof+0x629/0x9d0 mm/slub.c:5768
kmemdup_noprof+0x29/0x60 mm/util.c:138
kmemdup_noprof include/linux/fortify-string.h:765 [inline]
__devinet_sysctl_register+0xbc/0x360 net/ipv4/devinet.c:2665
devinet_sysctl_register net/ipv4/devinet.c:2717 [inline]
devinet_sysctl_register+0x17b/0x210 net/ipv4/devinet.c:2707
inetdev_init+0x2b8/0x570 net/ipv4/devinet.c:291
inetdev_event+0x7fa/0x17f0 net/ipv4/devinet.c:1590
notifier_call_chain+0x99/0x3b0 kernel/notifier.c:85
call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2243
call_netdevice_notifiers_extack net/core/dev.c:2281 [inline]
call_netdevice_notifiers net/core/dev.c:2295 [inline]
register_netdevice+0x16b9/0x21d0 net/core/dev.c:11444
page_owner free stack trace missing
Memory state around the buggy address:
ffff888056df3480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888056df3500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888056df3580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888056df3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888056df3680: 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