================================================================== BUG: KASAN: slab-use-after-free in handle_tx+0x1b4/0x5fc drivers/net/caif/caif_serial.c:222 Read of size 8 at addr ffff0000f1130020 by task aoe_tx0/2391 CPU: 1 UID: 0 PID: 2391 Comm: aoe_tx0 Not tainted 6.15.0-rc7-syzkaller-gd7fa1af5b33e #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:466 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 print_address_description+0xa8/0x254 mm/kasan/report.c:408 print_report+0x68/0x84 mm/kasan/report.c:521 kasan_report+0xb0/0x110 mm/kasan/report.c:634 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 handle_tx+0x1b4/0x5fc drivers/net/caif/caif_serial.c:222 caif_xmit+0x108/0x150 drivers/net/caif/caif_serial.c:268 __netdev_start_xmit include/linux/netdevice.h:5204 [inline] netdev_start_xmit include/linux/netdevice.h:5213 [inline] xmit_one net/core/dev.c:3776 [inline] dev_hard_start_xmit+0x2b0/0x8ac net/core/dev.c:3792 __dev_queue_xmit+0x15a4/0x31f0 net/core/dev.c:4629 dev_queue_xmit include/linux/netdevice.h:3350 [inline] tx+0x9c/0x1cc drivers/block/aoe/aoenet.c:62 kthread+0x164/0x354 drivers/block/aoe/aoecmd.c:1237 kthread+0x5fc/0x75c kernel/kthread.c:464 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:847 Allocated by task 7048: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x44/0x54 mm/kasan/generic.c:562 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x9c/0xb4 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x2a4/0x3fc mm/slub.c:4358 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] alloc_tty_struct+0xb8/0x654 drivers/tty/tty_io.c:3115 tty_init_dev+0x60/0x3e8 drivers/tty/tty_io.c:1409 tty_open_by_driver drivers/tty/tty_io.c:2082 [inline] tty_open+0x6e0/0xb54 drivers/tty/tty_io.c:2129 chrdev_open+0x1b0/0x4b0 fs/char_dev.c:414 do_dentry_open+0xb7c/0x1544 fs/open.c:956 vfs_open+0x44/0x2d4 fs/open.c:1086 do_open fs/namei.c:3880 [inline] path_openat+0x2424/0x2c40 fs/namei.c:4039 do_filp_open+0x18c/0x36c fs/namei.c:4066 do_sys_openat2+0x11c/0x1b4 fs/open.c:1429 do_sys_open fs/open.c:1444 [inline] __do_sys_openat fs/open.c:1460 [inline] __se_sys_openat fs/open.c:1455 [inline] __arm64_sys_openat+0x120/0x158 fs/open.c:1455 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x17c arch/arm64/kernel/entry-common.c:767 el0t_64_sync_handler+0x78/0x108 arch/arm64/kernel/entry-common.c:786 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 Freed by task 6290: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x58/0x70 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x68/0x88 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2380 [inline] slab_free mm/slub.c:4642 [inline] kfree+0x17c/0x474 mm/slub.c:4841 free_tty_struct drivers/tty/tty_io.c:174 [inline] release_one_tty+0x224/0x240 drivers/tty/tty_io.c:1542 process_one_work+0x7e8/0x156c kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x958/0xed8 kernel/workqueue.c:3400 kthread+0x5fc/0x75c kernel/kthread.c:464 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:847 Last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:47 kasan_record_aux_stack+0xb0/0xc8 mm/kasan/generic.c:548 insert_work+0x54/0x2cc kernel/workqueue.c:2183 __queue_work+0xdd8/0x1230 kernel/workqueue.c:2341 queue_work_on+0xdc/0x18c kernel/workqueue.c:2392 queue_work include/linux/workqueue.h:662 [inline] schedule_work include/linux/workqueue.h:723 [inline] queue_release_one_tty drivers/tty/tty_io.c:1553 [inline] kref_put include/linux/kref.h:65 [inline] tty_kref_put+0x144/0x1b8 drivers/tty/tty_io.c:1566 release_tty+0x3e8/0x4a4 drivers/tty/tty_io.c:1602 tty_release_struct+0xb4/0xd4 drivers/tty/tty_io.c:1701 tty_release+0xa0c/0x1208 drivers/tty/tty_io.c:1861 __fput+0x340/0x75c fs/file_table.c:465 ____fput+0x20/0x58 fs/file_table.c:493 task_work_run+0x1dc/0x260 kernel/task_work.c:227 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0x4e8/0x1998 kernel/exit.c:953 do_group_exit+0x194/0x22c kernel/exit.c:1102 get_signal+0x11dc/0x12f8 kernel/signal.c:3034 do_signal+0x274/0x4438 arch/arm64/kernel/signal.c:1615 do_notify_resume+0xac/0x1ec arch/arm64/kernel/entry-common.c:148 exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:169 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:178 [inline] el0_svc+0xb4/0x17c arch/arm64/kernel/entry-common.c:768 el0t_64_sync_handler+0x78/0x108 arch/arm64/kernel/entry-common.c:786 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 The buggy address belongs to the object at ffff0000f1130000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 32 bytes inside of freed 2048-byte region [ffff0000f1130000, ffff0000f1130800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x131130 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff0000d004f401 flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000040 ffff0000c000b3c0 fffffdffc356ce00 dead000000000002 raw: 0000000000000000 0000000000080008 00000000f5000000 ffff0000d004f401 head: 05ffc00000000040 ffff0000c000b3c0 fffffdffc356ce00 dead000000000002 head: 0000000000000000 0000000000080008 00000000f5000000 ffff0000d004f401 head: 05ffc00000000003 fffffdffc3c44c01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000f112ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000f112ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000f1130000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000f1130080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000f1130100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================