================================================================== BUG: KASAN: slab-use-after-free in handle_tx+0x1b4/0x5fc drivers/net/caif/caif_serial.c:222 Read of size 8 at addr ffff0000ccd93020 by task aoe_tx0/2411 CPU: 1 UID: 0 PID: 2411 Comm: aoe_tx0 Not tainted 6.16.0-rc2-syzkaller-g9aa9b43d689e #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:501 (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:5215 [inline] netdev_start_xmit include/linux/netdevice.h:5224 [inline] xmit_one net/core/dev.c:3830 [inline] dev_hard_start_xmit+0x2b0/0x890 net/core/dev.c:3846 __dev_queue_xmit+0x15a4/0x31f0 net/core/dev.c:4713 dev_queue_xmit include/linux/netdevice.h:3355 [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 6987: 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:4359 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:3102 tty_init_dev+0x60/0x3e8 drivers/tty/tty_io.c:1400 tty_open_by_driver drivers/tty/tty_io.c:2073 [inline] tty_open+0x6e0/0xb54 drivers/tty/tty_io.c:2120 chrdev_open+0x1b0/0x4b0 fs/char_dev.c:414 do_dentry_open+0xb7c/0x1544 fs/open.c:964 vfs_open+0x44/0x2d4 fs/open.c:1094 do_open fs/namei.c:3887 [inline] path_openat+0x2424/0x2c40 fs/namei.c:4046 do_filp_open+0x18c/0x36c fs/namei.c:4073 do_sys_openat2+0x11c/0x1b4 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_sys_openat fs/open.c:1468 [inline] __se_sys_openat fs/open.c:1463 [inline] __arm64_sys_openat+0x120/0x158 fs/open.c:1463 __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 6686: 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:2381 [inline] slab_free mm/slub.c:4643 [inline] kfree+0x17c/0x474 mm/slub.c:4842 free_tty_struct drivers/tty/tty_io.c:174 [inline] release_one_tty+0x224/0x240 drivers/tty/tty_io.c:1533 process_one_work+0x7e8/0x155c kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3321 [inline] worker_thread+0x958/0xed8 kernel/workqueue.c:3402 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:1544 [inline] kref_put include/linux/kref.h:65 [inline] tty_kref_put+0x144/0x1b8 drivers/tty/tty_io.c:1557 release_tty+0x3e8/0x4a4 drivers/tty/tty_io.c:1593 tty_release_struct+0xb4/0xd4 drivers/tty/tty_io.c:1692 tty_release+0xa0c/0x1208 drivers/tty/tty_io.c:1852 __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+0x51c/0x19fc kernel/exit.c:955 do_group_exit+0x194/0x22c kernel/exit.c:1104 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 ffff0000ccd93000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 32 bytes inside of freed 2048-byte region [ffff0000ccd93000, ffff0000ccd93800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff0000ccd90000 pfn:0x10cd90 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff0000f464e681 flags: 0x5ffc00000000240(workingset|head|node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000240 ffff0000c000b3c0 fffffdffc3d6b010 fffffdffc3f8c410 raw: ffff0000ccd90000 0000000000080001 00000000f5000000 ffff0000f464e681 head: 05ffc00000000240 ffff0000c000b3c0 fffffdffc3d6b010 fffffdffc3f8c410 head: ffff0000ccd90000 0000000000080001 00000000f5000000 ffff0000f464e681 head: 05ffc00000000003 fffffdffc3336401 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000ccd92f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000ccd92f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000ccd93000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000ccd93080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000ccd93100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================