syzbot


KASAN: use-after-free Read in handle_tx (2)

Status: upstream: reported on 2025/03/02 20:36
Reported-by: syzbot+d969e8bae04ce629eaf3@syzkaller.appspotmail.com
First crash: 196d, last: 1d07h
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 1312d 1425d 0/29 auto-closed as invalid on 2022/05/12 13:20
linux-5.15 KASAN: use-after-free Read in handle_tx 19 1 4d12h 4d12h 0/3 upstream: reported on 2025/09/11 06:15
upstream KASAN: use-after-free Read in handle_tx (2) net 19 1 947d 943d 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 322d 322d 0/3 auto-obsoleted due to no activity on 2025/02/05 09:49
upstream KASAN: slab-use-after-free Read in handle_tx (2) net 19 C 584 5h09m 572d 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 779d 775d 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 ffff888074af9018 by task aoe_tx0/1276

CPU: 0 PID: 1276 Comm: aoe_tx0 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0xa8/0x210 mm/kasan/report.c:420
 kasan_report+0x10b/0x140 mm/kasan/report.c:524
 handle_tx+0x1ed/0x600 drivers/net/caif/caif_serial.c:236
 __netdev_start_xmit include/linux/netdevice.h:4896 [inline]
 netdev_start_xmit include/linux/netdevice.h:4910 [inline]
 xmit_one net/core/dev.c:3670 [inline]
 dev_hard_start_xmit+0x262/0x870 net/core/dev.c:3686
 __dev_queue_xmit+0x1bf1/0x3760 net/core/dev.c:4346
 dev_queue_xmit include/linux/netdevice.h:3051 [inline]
 tx+0x67/0x170 drivers/block/aoe/aoenet.c:63
 kthread+0x1c6/0x3b0 drivers/block/aoe/aoecmd.c:1241
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Allocated by task 5011:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 alloc_tty_struct+0xa6/0x740 drivers/tty/tty_io.c:3089
 tty_init_dev+0x55/0x4c0 drivers/tty/tty_io.c:1408
 tty_open_by_driver drivers/tty/tty_io.c:2081 [inline]
 tty_open+0x5a3/0xd00 drivers/tty/tty_io.c:2128
 chrdev_open+0x597/0x670 fs/char_dev.c:414
 do_dentry_open+0x7e9/0x10d0 fs/open.c:882
 do_open fs/namei.c:3626 [inline]
 path_openat+0x25c6/0x2e70 fs/namei.c:3783
 do_filp_open+0x1c1/0x3c0 fs/namei.c:3810
 do_sys_openat2+0x142/0x490 fs/open.c:1318
 do_sys_open fs/open.c:1334 [inline]
 __do_sys_openat fs/open.c:1350 [inline]
 __se_sys_openat fs/open.c:1345 [inline]
 __x64_sys_openat+0x135/0x160 fs/open.c:1345
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 5300:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516
 ____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1729 [inline]
 slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1755
 slab_free mm/slub.c:3687 [inline]
 __kmem_cache_free+0xb6/0x1f0 mm/slub.c:3700
 process_one_work+0x898/0x1160 kernel/workqueue.c:2292
 worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
 insert_work+0x54/0x3c0 kernel/workqueue.c:1361
 __queue_work+0xba3/0xfb0 kernel/workqueue.c:1520
 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1548
 tty_release_struct+0xb4/0xd0 drivers/tty/tty_io.c:1700
 tty_release+0xc72/0x1600 drivers/tty/tty_io.c:1860
 __fput+0x22c/0x920 fs/file_table.c:320
 task_work_run+0x1ca/0x250 kernel/task_work.c:203
 exit_task_work include/linux/task_work.h:39 [inline]
 do_exit+0x93e/0x2400 kernel/exit.c:880
 do_group_exit+0x217/0x2d0 kernel/exit.c:1022
 get_signal+0x1272/0x1350 kernel/signal.c:2871
 arch_do_signal_or_restart+0xb0/0x1230 arch/x86/kernel/signal.c:871
 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174
 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Second to last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
 call_rcu+0x154/0x980 kernel/rcu/tree.c:2849
 in6_dev_put include/net/addrconf.h:388 [inline]
 addrconf_ifdown+0x178f/0x1a10 net/ipv6/addrconf.c:3954
 addrconf_notify+0x405/0xf40 net/ipv6/addrconf.c:-1
 notifier_call_chain kernel/notifier.c:87 [inline]
 raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:455
 call_netdevice_notifiers_extack net/core/dev.c:2039 [inline]
 call_netdevice_notifiers net/core/dev.c:2053 [inline]
 unregister_netdevice_many+0xfdc/0x1840 net/core/dev.c:10990
 vti6_exit_batch_net+0x3c6/0x410 net/ipv6/ip6_vti.c:1191
 ops_exit_list net/core/net_namespace.c:177 [inline]
 cleanup_net+0x77b/0xb80 net/core/net_namespace.c:640
 process_one_work+0x898/0x1160 kernel/workqueue.c:2292
 worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff888074af9000
 which belongs to the cache kmalloc-cg-2k of size 2048
The buggy address is located 24 bytes inside of
 2048-byte region [ffff888074af9000, ffff888074af9800)

The buggy address belongs to the physical page:
page:ffffea0001d2be00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x74af8
head:ffffea0001d2be00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88801b2bca01
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001520600 dead000000000002 ffff88801744c140
raw: 0000000000000000 0000000000080008 00000001ffffffff ffff88801b2bca01
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 4267, tgid 4267 (syz-executor), ts 73468427767, free_ts 73457862095
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
 prep_new_page mm/page_alloc.c:2539 [inline]
 get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614
 alloc_slab_page+0x5d/0x160 mm/slub.c:1799
 allocate_slab mm/slub.c:1944 [inline]
 new_slab+0x87/0x2c0 mm/slub.c:1997
 ___slab_alloc+0xbc6/0x1230 mm/slub.c:3154
 __slab_alloc mm/slub.c:3240 [inline]
 slab_alloc_node mm/slub.c:3325 [inline]
 __kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3398
 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1026
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 ipv6_add_dev+0xf8/0x1120 net/ipv6/addrconf.c:379
 addrconf_notify+0x634/0xf40 net/ipv6/addrconf.c:3595
 notifier_call_chain kernel/notifier.c:87 [inline]
 raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:455
 call_netdevice_notifiers_extack net/core/dev.c:2039 [inline]
 call_netdevice_notifiers net/core/dev.c:2053 [inline]
 register_netdevice+0x1600/0x1aa0 net/core/dev.c:10237
 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:317 [inline]
 nsim_create+0x35f/0x410 drivers/net/netdevsim/netdev.c:365
 __nsim_dev_port_add+0x695/0xaf0 drivers/net/netdevsim/dev.c:1396
 nsim_dev_port_add_all+0x35/0xe0 drivers/net/netdevsim/dev.c:1454
 nsim_drv_probe+0x814/0xaf0 drivers/net/netdevsim/dev.c:1608
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1459 [inline]
 free_pcp_prepare mm/page_alloc.c:1509 [inline]
 free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384
 free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479
 free_slab mm/slub.c:2036 [inline]
 discard_slab mm/slub.c:2042 [inline]
 __unfreeze_partials+0x1a5/0x200 mm/slub.c:2591
 put_cpu_partial+0x17c/0x250 mm/slub.c:2667
 qlink_free mm/kasan/quarantine.c:168 [inline]
 qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
 kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
 __kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
 slab_alloc_node mm/slub.c:3359 [inline]
 slab_alloc mm/slub.c:3367 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3374 [inline]
 kmem_cache_alloc_lru+0x11a/0x2e0 mm/slub.c:3390
 alloc_inode_sb include/linux/fs.h:3245 [inline]
 alloc_inode fs/inode.c:263 [inline]
 new_inode_pseudo+0x7e/0x1c0 fs/inode.c:1063
 new_inode+0x25/0x1c0 fs/inode.c:1091
 debugfs_get_inode fs/debugfs/inode.c:72 [inline]
 __debugfs_create_file+0x148/0x510 fs/debugfs/inode.c:432
 nsim_ethtool_init+0x277/0x3e0 drivers/net/netdevsim/ethtool.c:187
 nsim_create+0x1d1/0x410 drivers/net/netdevsim/netdev.c:363
 __nsim_dev_port_add+0x695/0xaf0 drivers/net/netdevsim/dev.c:1396
 nsim_dev_port_add_all+0x35/0xe0 drivers/net/netdevsim/dev.c:1454

Memory state around the buggy address:
 ffff888074af8f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888074af8f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888074af9000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff888074af9080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888074af9100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/14 10:44 linux-6.1.y 3db754f56897 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in handle_tx
2025/09/12 08:18 linux-6.1.y 3db754f56897 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in handle_tx
2025/09/05 02:50 linux-6.1.y 28c695c365e1 d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in handle_tx
2025/09/12 06:10 linux-6.1.y 3db754f56897 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in handle_tx
2025/09/11 01:44 linux-6.1.y f97f1002271b fdeaa69b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in handle_tx
2025/09/05 00:37 linux-6.1.y 28c695c365e1 d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in handle_tx
2025/09/04 12:13 linux-6.1.y f89b6e15694c d291dd2d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in handle_tx
2025/09/03 11:55 linux-6.1.y f89b6e15694c 96a211bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in handle_tx
2025/08/02 14:04 linux-6.1.y 3594f306da12 7368264b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in handle_tx
2025/07/07 15:16 linux-6.1.y 04d1ccaa9c28 4f67c4ae .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in handle_tx
2025/06/28 08:48 linux-6.1.y 7e69c33e4858 fc9d8ee5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in handle_tx
2025/03/25 07:53 linux-6.1.y 344a09659766 875573af .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in handle_tx
2025/03/07 11:05 linux-6.1.y 3a8358583626 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in handle_tx
2025/03/02 20:35 linux-6.1.y 3a8358583626 c3901742 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in handle_tx
* Struck through repros no longer work on HEAD.