Hello,
syzbot found the following issue on:
HEAD commit: c16c81c81336 Linux 5.15.178
git tree: linux-5.15.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=126b42a4580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=d302c69e93fb6774
dashboard link:
https://syzkaller.appspot.com/bug?extid=039af3c73abccd08231b
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/267e46ee7273/disk-c16c81c8.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/944e289206cf/vmlinux-c16c81c8.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/f8cadf62458e/bzImage-c16c81c8.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+039af3...@syzkaller.appspotmail.com
ieee802154 phy1 wpan1: encryption failed: -22
==================================================================
BUG: KASAN: use-after-free in tty_write_room+0x31/0x80 drivers/tty/tty_ioctl.c:78
Read of size 8 at addr ffff888073758018 by task aoe_tx0/1424
CPU: 1 PID: 1424 Comm: aoe_tx0 Not tainted 5.15.178-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
print_address_description+0x63/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
tty_write_room+0x31/0x80 drivers/tty/tty_ioctl.c:78
handle_tx+0x164/0x620 drivers/net/caif/caif_serial.c:226
__netdev_start_xmit include/linux/netdevice.h:5019 [inline]
netdev_start_xmit include/linux/netdevice.h:5033 [inline]
xmit_one net/core/dev.c:3617 [inline]
dev_hard_start_xmit+0x298/0x7a0 net/core/dev.c:3633
__dev_queue_xmit+0x1c8e/0x32b0 net/core/dev.c:4256
tx+0x65/0x160 drivers/block/aoe/aoenet.c:63
kthread+0x234/0x440 drivers/block/aoe/aoecmd.c:1238
kthread+0x3f6/0x4f0 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
</TASK>
Allocated by task 25703:
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+0xba/0xf0 mm/kasan/common.c:513
kasan_kmalloc include/linux/kasan.h:264 [inline]
kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247
kmalloc include/linux/slab.h:591 [inline]
kzalloc include/linux/slab.h:721 [inline]
alloc_tty_struct+0xa5/0x7b0 drivers/tty/tty_io.c:3127
tty_init_dev+0x56/0x4b0 drivers/tty/tty_io.c:1424
ptmx_open+0xdc/0x2c0 drivers/tty/pty.c:824
chrdev_open+0x54a/0x630 fs/char_dev.c:414
do_dentry_open+0x807/0xfb0 fs/open.c:826
do_open fs/namei.c:3608 [inline]
path_openat+0x2705/0x2f20 fs/namei.c:3742
do_filp_open+0x21c/0x460 fs/namei.c:3769
do_sys_openat2+0x13b/0x4f0 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]
__x64_sys_openat+0x243/0x290 fs/open.c:1280
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Freed by task 5324:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x80 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kfree+0xf1/0x270 mm/slub.c:4559
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
kthread+0x3f6/0x4f0 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Last potentially related work creation:
kasan_save_stack+0x36/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348
insert_work+0x54/0x3e0 kernel/workqueue.c:1366
__queue_work+0x963/0xd00 kernel/workqueue.c:1532
queue_work_on+0x14b/0x250 kernel/workqueue.c:1559
tty_release_struct+0xb8/0xd0 drivers/tty/tty_io.c:1719
tty_release+0xd53/0x1310 drivers/tty/tty_io.c:1880
__fput+0x3fe/0x8e0 fs/file_table.c:280
task_work_run+0x129/0x1a0 kernel/task_work.c:188
exit_task_work include/linux/task_work.h:33 [inline]
do_exit+0x6a3/0x2480 kernel/exit.c:874
do_group_exit+0x144/0x310 kernel/exit.c:996
get_signal+0xc66/0x14e0 kernel/signal.c:2900
arch_do_signal_or_restart+0xc3/0x1890 arch/x86/kernel/signal.c:867
handle_signal_work kernel/entry/common.c:154 [inline]
exit_to_user_mode_loop+0x97/0x130 kernel/entry/common.c:178
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307
do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0
The buggy address belongs to the object at ffff888073758000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 24 bytes inside of
2048-byte region [ffff888073758000, ffff888073758800)
The buggy address belongs to the page:
page:ffffea0001cdd600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x73758
head:ffffea0001cdd600 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888017442000
raw: 0000000000000000 0000000000080008 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 0x1d2800(GFP_NOWAIT|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 22609, ts 1044025426391, free_ts 1044005143455
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192
__alloc_pages+0x272/0x700 mm/page_alloc.c:5465
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xbb/0x4b0 mm/slub.c:1975
___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
__kmalloc_node_track_caller+0x1f6/0x390 mm/slub.c:4958
kmalloc_reserve net/core/skbuff.c:356 [inline]
pskb_expand_head+0x111/0x1130 net/core/skbuff.c:1709
netlink_trim+0x183/0x220 net/netlink/af_netlink.c:1293
netlink_broadcast_filtered+0x62/0x11a0 net/netlink/af_netlink.c:1498
netlink_broadcast net/netlink/af_netlink.c:1543 [inline]
nlmsg_multicast include/net/netlink.h:1033 [inline]
nlmsg_notify+0xf7/0x1b0 net/netlink/af_netlink.c:2532
dev_close_many+0x2a6/0x530 net/core/dev.c:1618
unregister_netdevice_many+0x4b0/0x18f0 net/core/dev.c:11078
unregister_netdevice_queue+0x2e6/0x350 net/core/dev.c:11035
unregister_netdevice include/linux/netdevice.h:3012 [inline]
nsim_destroy+0x44/0x140 drivers/net/netdevsim/netdev.c:382
__nsim_dev_port_del+0x153/0x1b0 drivers/net/netdevsim/dev.c:1349
nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1362 [inline]
nsim_dev_reload_destroy+0x15e/0x240 drivers/net/netdevsim/dev.c:1561
nsim_dev_remove+0x59/0x100 drivers/net/netdevsim/dev.c:1577
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317
free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396
do_slab_free mm/slub.c:3487 [inline]
___cache_free+0xe3/0x100 mm/slub.c:3506
qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3220 [inline]
kmem_cache_alloc_node+0x121/0x2c0 mm/slub.c:3256
__alloc_skb+0xdd/0x590 net/core/skbuff.c:415
alloc_skb include/linux/skbuff.h:1162 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
devlink_port_notify+0x2a/0x170 net/core/devlink.c:1048
devlink_port_unregister+0xab/0x230 net/core/devlink.c:9142
__nsim_dev_port_del+0x181/0x1b0 drivers/net/netdevsim/dev.c:1351
nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1362 [inline]
nsim_dev_reload_destroy+0x15e/0x240 drivers/net/netdevsim/dev.c:1561
nsim_dev_remove+0x59/0x100 drivers/net/netdevsim/dev.c:1577
__device_release_driver drivers/base/dd.c:1227 [inline]
device_release_driver_internal+0x4cb/0x7f0 drivers/base/dd.c:1262
bus_remove_device+0x2e5/0x400 drivers/base/bus.c:531
Memory state around the buggy address:
ffff888073757f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888073757f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888073758000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888073758080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888073758100: 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