syzbot


KASAN: use-after-free Read in handle_tx

Status: upstream: reported on 2025/09/11 06:15
Reported-by: syzbot+bf3c7bc6c4b015814d72@syzkaller.appspotmail.com
First crash: 54d, last: 4d03h
Similar bugs (6)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in handle_tx net 19 15 1361d 1474d 0/29 auto-closed as invalid on 2022/05/12 13:20
upstream KASAN: use-after-free Read in handle_tx (2) net 19 1 997d 993d 0/29 auto-obsoleted due to no activity on 2023/05/11 18:22
linux-6.1 KASAN: use-after-free Read in handle_tx 19 1 371d 371d 0/3 auto-obsoleted due to no activity on 2025/02/05 09:49
linux-6.1 KASAN: use-after-free Read in handle_tx (2) 19 18 6d04h 246d 0/3 upstream: reported on 2025/03/02 20:36
upstream KASAN: slab-use-after-free Read in handle_tx (2) net 19 C 863 1h54m 621d 0/29 upstream: reported C repro on 2024/02/21 10:58
upstream KASAN: slab-use-after-free Read in handle_tx net 19 1 828d 824d 0/29 auto-obsoleted due to no activity on 2023/10/27 13:43

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in handle_tx+0x1ed/0x600 drivers/net/caif/caif_serial.c:236
Read of size 8 at addr ffff888061225018 by task aoe_tx0/1423

CPU: 0 PID: 1423 Comm: aoe_tx0 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 print_address_description+0x60/0x2d0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xdf/0x130 mm/kasan/report.c:451
 handle_tx+0x1ed/0x600 drivers/net/caif/caif_serial.c:236
 __netdev_start_xmit include/linux/netdevice.h:5036 [inline]
 netdev_start_xmit include/linux/netdevice.h:5050 [inline]
 xmit_one net/core/dev.c:3649 [inline]
 dev_hard_start_xmit+0x2a5/0x7e0 net/core/dev.c:3665
 __dev_queue_xmit+0x19df/0x2ed0 net/core/dev.c:4288
 tx+0x65/0x160 drivers/block/aoe/aoenet.c:63
 kthread+0x1bc/0x390 drivers/block/aoe/aoecmd.c:1238
 kthread+0x436/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
 </TASK>

Allocated by task 6544:
 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+0xb5/0xf0 mm/kasan/common.c:522
 kmalloc include/linux/slab.h:607 [inline]
 kzalloc include/linux/slab.h:738 [inline]
 alloc_tty_struct+0xa6/0x780 drivers/tty/tty_io.c:3127
 tty_init_dev+0x56/0x470 drivers/tty/tty_io.c:1424
 tty_open_by_driver drivers/tty/tty_io.c:2100 [inline]
 tty_open+0x5b9/0xd20 drivers/tty/tty_io.c:2148
 chrdev_open+0x597/0x670 fs/char_dev.c:414
 do_dentry_open+0x7ff/0xf80 fs/open.c:826
 do_open fs/namei.c:3616 [inline]
 path_openat+0x2682/0x2f30 fs/namei.c:3750
 do_filp_open+0x1b3/0x3e0 fs/namei.c:3777
 do_sys_openat2+0x142/0x4a0 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+0x135/0x160 fs/open.c:1280
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 6560:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1710 [inline]
 slab_free_freelist_hook+0xea/0x170 mm/slub.c:1736
 slab_free mm/slub.c:3504 [inline]
 kfree+0xef/0x2a0 mm/slub.c:4564
 process_one_work+0x863/0x1000 kernel/workqueue.c:2310
 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
 kthread+0x436/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Last potentially related work creation:
 kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
 insert_work+0x54/0x3d0 kernel/workqueue.c:1366
 __queue_work+0x9c5/0xd50 kernel/workqueue.c:1532
 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1559
 tty_release_struct+0xb4/0xd0 drivers/tty/tty_io.c:1719
 tty_release+0xd0c/0x16c0 drivers/tty/tty_io.c:1880
 __fput+0x234/0x930 fs/file_table.c:311
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 exit_task_work include/linux/task_work.h:33 [inline]
 do_exit+0x61e/0x20a0 kernel/exit.c:883
 do_group_exit+0x12e/0x300 kernel/exit.c:997
 get_signal+0x6ca/0x12c0 kernel/signal.c:2900
 arch_do_signal_or_restart+0xc1/0x1300 arch/x86/kernel/signal.c:867
 handle_signal_work kernel/entry/common.c:154 [inline]
 exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:178
 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Second to last potentially related work creation:
 kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
 __call_rcu kernel/rcu/tree.c:3011 [inline]
 call_rcu+0x182/0x930 kernel/rcu/tree.c:3091
 netlink_release+0x134f/0x1790 net/netlink/af_netlink.c:799
 __sock_release net/socket.c:651 [inline]
 sock_close+0xd5/0x240 net/socket.c:1346
 __fput+0x234/0x930 fs/file_table.c:311
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff888061225000
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 24 bytes inside of
 2048-byte region [ffff888061225000, ffff888061225800)
The buggy address belongs to the page:
page:ffffea0001848800 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888061227000 pfn:0x61220
head:ffffea0001848800 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001d78008 ffffea000184da08 ffff888016842000
raw: ffff888061227000 0000000000080006 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4186, ts 64033532162, free_ts 21142230705
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487
 alloc_slab_page mm/slub.c:1780 [inline]
 allocate_slab mm/slub.c:1917 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1980
 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3013
 __slab_alloc mm/slub.c:3100 [inline]
 slab_alloc_node mm/slub.c:3191 [inline]
 slab_alloc mm/slub.c:3233 [inline]
 __kmalloc+0x1cd/0x330 mm/slub.c:4408
 kmalloc include/linux/slab.h:612 [inline]
 kzalloc include/linux/slab.h:738 [inline]
 __register_sysctl_table+0xe0/0x1230 fs/proc/proc_sysctl.c:1324
 __devinet_sysctl_register+0x2c1/0x380 net/ipv4/devinet.c:2603
 devinet_sysctl_register+0x17c/0x1f0 net/ipv4/devinet.c:2643
 inetdev_init+0x28c/0x4d0 net/ipv4/devinet.c:277
 inetdev_event+0x280/0x1360 net/ipv4/devinet.c:1543
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
 call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
 call_netdevice_notifiers net/core/dev.c:2075 [inline]
 register_netdevice+0x1275/0x16b0 net/core/dev.c:10428
 veth_newlink+0x8ed/0xda0 drivers/net/veth.c:1714
 __rtnl_newlink net/core/rtnetlink.c:3526 [inline]
 rtnl_newlink+0x114c/0x17d0 net/core/rtnetlink.c:3574
 rtnetlink_rcv_msg+0x7ff/0xe90 net/core/rtnetlink.c:5684
 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2507
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+0x637/0x6c0 mm/page_alloc.c:3317
 free_unref_page+0x94/0x280 mm/page_alloc.c:3396
 free_contig_range+0x96/0xf0 mm/page_alloc.c:9406
 destroy_args+0x100/0xa20 mm/debug_vm_pgtable.c:1018
 debug_vm_pgtable+0x318/0x370 mm/debug_vm_pgtable.c:1336
 do_one_initcall+0x1ee/0x680 init/main.c:1316
 do_initcall_level+0x137/0x1f0 init/main.c:1389
 do_initcalls+0x4b/0x90 init/main.c:1405
 kernel_init_freeable+0x3ce/0x560 init/main.c:1629
 kernel_init+0x19/0x1b0 init/main.c:1520
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Memory state around the buggy address:
 ffff888061224f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888061224f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888061225000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff888061225080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888061225100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/31 05:04 linux-5.15.y cc5ec8769306 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in handle_tx
2025/09/11 06:14 linux-5.15.y de9476bb4f1b fdeaa69b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in handle_tx
* Struck through repros no longer work on HEAD.