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: 241d, last: 1d02h
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 1356d 1469d 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 49d 49d 0/3 upstream: reported on 2025/09/11 06:15
upstream KASAN: use-after-free Read in handle_tx (2) net 19 1 992d 988d 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 366d 366d 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 838 10m 616d 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 823d 819d 0/29 auto-obsoleted due to no activity on 2023/10/27 13:43

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in update_tty_status drivers/net/caif/caif_serial.c:90 [inline]
BUG: KASAN: use-after-free in handle_tx+0x463/0x600 drivers/net/caif/caif_serial.c:237
Read of size 1 at addr ffff88801f70d490 by task aoe_tx0/1277

CPU: 1 PID: 1277 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
 update_tty_status drivers/net/caif/caif_serial.c:90 [inline]
 handle_tx+0x463/0x600 drivers/net/caif/caif_serial.c:237
 __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 12997:
 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 4402:
 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
 kvfree_call_rcu+0x108/0x870 kernel/rcu/tree.c:3405
 drop_sysctl_table+0x2fa/0x430 fs/proc/proc_sysctl.c:1731
 unregister_sysctl_table+0x85/0x130 fs/proc/proc_sysctl.c:1769
 __devinet_sysctl_unregister net/ipv4/devinet.c:2635 [inline]
 devinet_sysctl_unregister net/ipv4/devinet.c:2663 [inline]
 inetdev_destroy net/ipv4/devinet.c:329 [inline]
 inetdev_event+0x6db/0x1410 net/ipv4/devinet.c:1615
 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
 rtnl_delete_link net/core/rtnetlink.c:3175 [inline]
 rtnl_dellink+0x3e5/0x730 net/core/rtnetlink.c:3226
 rtnetlink_rcv_msg+0x79b/0xed0 net/core/rtnetlink.c:6153
 netlink_rcv_skb+0x1de/0x420 net/netlink/af_netlink.c:2511
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x74d/0x8d0 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x89e/0xbc0 net/netlink/af_netlink.c:1872
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 ____sys_sendmsg+0x59b/0x970 net/socket.c:2519
 ___sys_sendmsg+0x21c/0x290 net/socket.c:2573
 __sys_sendmsg net/socket.c:2602 [inline]
 __do_sys_sendmsg net/socket.c:2611 [inline]
 __se_sys_sendmsg+0x19e/0x270 net/socket.c:2609
 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

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

The buggy address belongs to the physical page:
page:ffffea00007dc200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801f70c000 pfn:0x1f708
head:ffffea00007dc200 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff888068417e81
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0000bb6208 ffffea00015c1608 ffff88801744c140
raw: ffff88801f70c000 0000000000080005 00000001ffffffff ffff888068417e81
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 4269, tgid 4269 (syz-executor), ts 74306724430, free_ts 74304676741
 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
 __do_kmalloc_node mm/slab_common.c:935 [inline]
 __kmalloc+0xa0/0x240 mm/slab_common.c:949
 kmalloc include/linux/slab.h:568 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 __register_sysctl_table+0xef/0xe70 fs/proc/proc_sysctl.c:1345
 __devinet_sysctl_register+0x253/0x320 net/ipv4/devinet.c:2612
 devinet_sysctl_register+0x17c/0x1f0 net/ipv4/devinet.c:2652
 inetdev_init+0x2b4/0x4f0 net/ipv4/devinet.c:280
 inetdev_event+0x270/0x1410 net/ipv4/devinet.c:1547
 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
 bond_newlink+0x39/0x80 drivers/net/bonding/bond_netlink.c:576
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
 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]
 __kmem_cache_alloc_node+0x140/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]
 ref_tracker_alloc+0x129/0x450 lib/ref_tracker.c:85
 __netdev_tracker_alloc include/linux/netdevice.h:4051 [inline]
 netdev_hold include/linux/netdevice.h:4080 [inline]
 netdev_queue_add_kobject net/core/net-sysfs.c:1661 [inline]
 netdev_queue_update_kobjects+0x18d/0x480 net/core/net-sysfs.c:1716
 register_queue_kobjects net/core/net-sysfs.c:1777 [inline]
 netdev_register_kobject+0x265/0x310 net/core/net-sysfs.c:2017
 register_netdevice+0x12b9/0x1aa0 net/core/dev.c:10204
 bond_newlink+0x39/0x80 drivers/net/bonding/bond_netlink.c:576
 rtnl_newlink_create net/core/rtnetlink.c:3422 [inline]
 __rtnl_newlink net/core/rtnetlink.c:3642 [inline]
 rtnl_newlink+0x14c4/0x1ff0 net/core/rtnetlink.c:3655
 rtnetlink_rcv_msg+0x79b/0xed0 net/core/rtnetlink.c:6153
 netlink_rcv_skb+0x1de/0x420 net/netlink/af_netlink.c:2511

Memory state around the buggy address:
 ffff88801f70d380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88801f70d400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88801f70d480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff88801f70d500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88801f70d580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (18):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/11 16:03 linux-6.1.y 882efbdd9d34 ff1712fe .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/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/10/29 04:24 linux-6.1.y 8e6e2188d949 fd2207e7 .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/10/11 15:19 linux-6.1.y 882efbdd9d34 ff1712fe .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/10/11 15:16 linux-6.1.y 882efbdd9d34 ff1712fe .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/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.