syzbot


KASAN: use-after-free Read in seq_printf

Status: premoderation: reported on 2025/09/18 23:28
Reported-by: syzbot+06a8b327a52c3a7c4410@syzkaller.appspotmail.com
First crash: 19h27m, last: 19h27m
Similar bugs (5)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 KASAN: use-after-free Read in seq_printf 19 11 1d11h 102d 0/2 premoderation: reported on 2025/06/08 22:35
upstream KASAN: slab-out-of-bounds Read in seq_printf fs 19 5 131d 236d 0/29 auto-obsoleted due to no activity on 2025/08/09 17:54
upstream KMSAN: uninit-value in seq_printf (2) fs 7 C 99 1192d 1458d 0/29 auto-closed as invalid on 2022/09/30 02:43
upstream KMSAN: kernel-infoleak in __skb_datagram_iter net 9 68 724d 829d 23/29 fixed on 2023/09/28 17:51
android-6-1 KASAN: slab-out-of-bounds Read in seq_printf 17 1 4d08h 4d08h 0/2 premoderation: reported on 2025/09/15 09:58

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in string_nocheck lib/vsprintf.c:642 [inline]
BUG: KASAN: use-after-free in string+0x21f/0x2b0 lib/vsprintf.c:724
Read of size 1 at addr ffff88810daf9cc9 by task syz.1.4065/16230

CPU: 0 PID: 16230 Comm: syz.1.4065 Tainted: G        W         syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
 <TASK>
 __dump_stack+0x21/0x30 lib/dump_stack.c:88
 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106
 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:427 [inline]
 kasan_report+0xf1/0x140 mm/kasan/report.c:444
 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306
 string_nocheck lib/vsprintf.c:642 [inline]
 string+0x21f/0x2b0 lib/vsprintf.c:724
 vsnprintf+0xed9/0x1960 lib/vsprintf.c:2811
 seq_vprintf fs/seq_file.c:407 [inline]
 seq_printf+0x175/0x260 fs/seq_file.c:422
 input_devices_seq_show+0x1a6/0x650 drivers/input/input.c:1190
 seq_read_iter+0x93f/0xd30 fs/seq_file.c:272
 seq_read+0x3cc/0x4d0 fs/seq_file.c:162
 pde_read fs/proc/inode.c:311 [inline]
 proc_reg_read+0x1c4/0x2b0 fs/proc/inode.c:323
 vfs_read+0x282/0xbe0 fs/read_write.c:483
 ksys_read+0x140/0x240 fs/read_write.c:623
 __do_sys_read fs/read_write.c:633 [inline]
 __se_sys_read fs/read_write.c:631 [inline]
 __x64_sys_read+0x7b/0x90 fs/read_write.c:631
 x64_sys_call+0x96d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:1
 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
RIP: 0033:0x7fd574dc6ba9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fd57380e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007fd57500e090 RCX: 00007fd574dc6ba9
RDX: 0000000000002020 RSI: 0000200000000040 RDI: 000000000000000d
RBP: 00007fd574e49e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd57500e128 R14: 00007fd57500e090 R15: 00007ffe16c1e358
 </TASK>

Allocated by task 16153:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:45 [inline]
 set_alloc_info mm/kasan/common.c:433 [inline]
 ____kasan_kmalloc mm/kasan/common.c:512 [inline]
 __kasan_kmalloc+0xda/0x110 mm/kasan/common.c:521
 kasan_kmalloc include/linux/kasan.h:227 [inline]
 __kmalloc+0x13d/0x2c0 mm/slub.c:4436
 kmalloc include/linux/slab.h:621 [inline]
 kzalloc include/linux/slab.h:747 [inline]
 fib6_info_alloc+0x34/0xe0 net/ipv6/ip6_fib.c:155
 ip6_route_info_create+0x526/0x1510 net/ipv6/route.c:3784
 ip6_route_add+0x27/0x130 net/ipv6/route.c:3880
 addrconf_prefix_route net/ipv6/addrconf.c:2468 [inline]
 add_v4_addrs+0x780/0xa70 net/ipv6/addrconf.c:3217
 addrconf_gre_config net/ipv6/addrconf.c:3494 [inline]
 addrconf_init_auto_addrs+0x895/0xb90 net/ipv6/addrconf.c:3509
 addrconf_notify+0x95d/0xde0 net/ipv6/addrconf.c:3686
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0x90/0x100 kernel/notifier.c:391
 call_netdevice_notifiers_info net/core/dev.c:2057 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2069 [inline]
 call_netdevice_notifiers net/core/dev.c:2083 [inline]
 __dev_notify_flags+0x28f/0x500 net/core/dev.c:-1
 rtnl_configure_link+0x22e/0x330 net/core/rtnetlink.c:-1
 __rtnl_newlink net/core/rtnetlink.c:3532 [inline]
 rtnl_newlink+0x1358/0x17b0 net/core/rtnetlink.c:3572
 rtnetlink_rcv_msg+0x9e4/0xb90 net/core/rtnetlink.c:5650
 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2511
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5668
 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline]
 netlink_unicast+0x876/0xa40 net/netlink/af_netlink.c:1348
 netlink_sendmsg+0x86a/0xb70 net/netlink/af_netlink.c:1922
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 ____sys_sendmsg+0x5a2/0x8c0 net/socket.c:2436
 ___sys_sendmsg+0x1f0/0x260 net/socket.c:2490
 __sys_sendmsg net/socket.c:2519 [inline]
 __do_sys_sendmsg net/socket.c:2528 [inline]
 __se_sys_sendmsg net/socket.c:2526 [inline]
 __x64_sys_sendmsg+0x1e2/0x2a0 net/socket.c:2526
 x64_sys_call+0x4b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:47
 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 16146:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4a/0x70 mm/kasan/common.c:45
 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:365
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373
 kasan_slab_free include/linux/kasan.h:193 [inline]
 slab_free_hook mm/slub.c:1728 [inline]
 slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1754
 slab_free mm/slub.c:3526 [inline]
 kfree+0xc4/0x270 mm/slub.c:4588
 fib6_info_destroy_rcu+0x171/0x1c0 net/ipv6/ip6_fib.c:178
 rcu_do_batch+0x51d/0xba0 kernel/rcu/tree.c:2523
 rcu_core+0x5e4/0xf80 kernel/rcu/tree.c:2763
 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776
 handle_softirqs+0x250/0x560 kernel/softirq.c:583
 __do_softirq kernel/softirq.c:621 [inline]
 invoke_softirq kernel/softirq.c:443 [inline]
 __irq_exit_rcu+0x52/0xf0 kernel/softirq.c:670
 irq_exit_rcu+0x9/0x10 kernel/softirq.c:682
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline]
 sysvec_apic_timer_interrupt+0xa9/0xc0 arch/x86/kernel/apic/apic.c:1108
 asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:676

Last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38
 __kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348
 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
 __call_rcu_common kernel/rcu/tree.c:3011 [inline]
 call_rcu+0x105/0xfe0 kernel/rcu/tree.c:3129
 fib6_info_release include/net/ip6_fib.h:349 [inline]
 ip6_route_add+0xe4/0x130 net/ipv6/route.c:3885
 addrconf_prefix_route net/ipv6/addrconf.c:2468 [inline]
 add_v4_addrs+0x780/0xa70 net/ipv6/addrconf.c:3217
 addrconf_gre_config net/ipv6/addrconf.c:3494 [inline]
 addrconf_init_auto_addrs+0x895/0xb90 net/ipv6/addrconf.c:3509
 addrconf_notify+0x95d/0xde0 net/ipv6/addrconf.c:3686
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0x90/0x100 kernel/notifier.c:391
 call_netdevice_notifiers_info net/core/dev.c:2057 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2069 [inline]
 call_netdevice_notifiers net/core/dev.c:2083 [inline]
 __dev_notify_flags+0x28f/0x500 net/core/dev.c:-1
 rtnl_configure_link+0x22e/0x330 net/core/rtnetlink.c:-1
 __rtnl_newlink net/core/rtnetlink.c:3532 [inline]
 rtnl_newlink+0x1358/0x17b0 net/core/rtnetlink.c:3572
 rtnetlink_rcv_msg+0x9e4/0xb90 net/core/rtnetlink.c:5650
 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2511
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5668
 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline]
 netlink_unicast+0x876/0xa40 net/netlink/af_netlink.c:1348
 netlink_sendmsg+0x86a/0xb70 net/netlink/af_netlink.c:1922
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 ____sys_sendmsg+0x5a2/0x8c0 net/socket.c:2436
 ___sys_sendmsg+0x1f0/0x260 net/socket.c:2490
 __sys_sendmsg net/socket.c:2519 [inline]
 __do_sys_sendmsg net/socket.c:2528 [inline]
 __se_sys_sendmsg net/socket.c:2526 [inline]
 __x64_sys_sendmsg+0x1e2/0x2a0 net/socket.c:2526
 x64_sys_call+0x4b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:47
 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

Second to last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38
 __kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348
 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
 __call_rcu_common kernel/rcu/tree.c:3011 [inline]
 call_rcu+0x105/0xfe0 kernel/rcu/tree.c:3129
 fib6_info_release include/net/ip6_fib.h:349 [inline]
 fib6_del_route net/ipv6/ip6_fib.c:1998 [inline]
 fib6_del+0xc50/0xf60 net/ipv6/ip6_fib.c:2031
 fib6_clean_node+0x296/0x520 net/ipv6/ip6_fib.c:2193
 fib6_walk_continue+0x4fc/0x700 net/ipv6/ip6_fib.c:2115
 fib6_walk+0x153/0x290 net/ipv6/ip6_fib.c:2163
 fib6_clean_tree net/ipv6/ip6_fib.c:2243 [inline]
 __fib6_clean_all net/ipv6/ip6_fib.c:2259 [inline]
 fib6_clean_all+0x16a/0x230 net/ipv6/ip6_fib.c:2270
 rt6_sync_down_dev net/ipv6/route.c:4907 [inline]
 rt6_disable_ip+0x119/0x700 net/ipv6/route.c:4912
 addrconf_ifdown+0x144/0x1880 net/ipv6/addrconf.c:3799
 addrconf_notify+0x3bd/0xde0 net/ipv6/addrconf.c:-1
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0x90/0x100 kernel/notifier.c:391
 call_netdevice_notifiers_info net/core/dev.c:2057 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2069 [inline]
 call_netdevice_notifiers net/core/dev.c:2083 [inline]
 __dev_notify_flags+0x28f/0x500 net/core/dev.c:-1
 dev_change_flags+0xe8/0x1a0 net/core/dev.c:8937
 do_setlink+0xbed/0x3990 net/core/rtnetlink.c:2779
 rtnl_group_changelink net/core/rtnetlink.c:3296 [inline]
 __rtnl_newlink net/core/rtnetlink.c:3460 [inline]
 rtnl_newlink+0xd6b/0x17b0 net/core/rtnetlink.c:3572
 rtnetlink_rcv_msg+0x9e4/0xb90 net/core/rtnetlink.c:5650
 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2511
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5668
 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline]
 netlink_unicast+0x876/0xa40 net/netlink/af_netlink.c:1348
 netlink_sendmsg+0x86a/0xb70 net/netlink/af_netlink.c:1922
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 ____sys_sendmsg+0x5a2/0x8c0 net/socket.c:2436
 ___sys_sendmsg+0x1f0/0x260 net/socket.c:2490
 __sys_sendmsg net/socket.c:2519 [inline]
 __do_sys_sendmsg net/socket.c:2528 [inline]
 __se_sys_sendmsg net/socket.c:2526 [inline]
 __x64_sys_sendmsg+0x1e2/0x2a0 net/socket.c:2526
 x64_sys_call+0x4b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:47
 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

The buggy address belongs to the object at ffff88810daf9c00
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 201 bytes inside of
 512-byte region [ffff88810daf9c00, ffff88810daf9e00)
The buggy address belongs to the page:
page:ffffea000436be00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10daf8
head:ffffea000436be00 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 0000000000000000 0000000a00000001 ffff888100042f00
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 90, ts 5173422266, free_ts 0
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611
 get_page_from_freelist+0x2cc5/0x2d50 mm/page_alloc.c:4485
 __alloc_pages+0x18f/0x440 mm/page_alloc.c:5808
 alloc_slab_page mm/slub.c:-1 [inline]
 allocate_slab mm/slub.c:1937 [inline]
 new_slab+0xa1/0x4d0 mm/slub.c:2000
 ___slab_alloc+0x381/0x810 mm/slub.c:3033
 __slab_alloc+0x49/0x90 mm/slub.c:3120
 slab_alloc_node mm/slub.c:3211 [inline]
 slab_alloc mm/slub.c:3255 [inline]
 __kmalloc_track_caller+0x169/0x2c0 mm/slub.c:4954
 kmalloc_reserve net/core/skbuff.c:357 [inline]
 __alloc_skb+0x21a/0x740 net/core/skbuff.c:428
 alloc_skb include/linux/skbuff.h:1183 [inline]
 alloc_skb_with_frags+0xa8/0x620 net/core/skbuff.c:6194
 sock_alloc_send_pskb+0x853/0x980 net/core/sock.c:2537
 unix_dgram_sendmsg+0x5ea/0x1880 net/unix/af_unix.c:1816
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 __sys_sendto+0x423/0x580 net/socket.c:2063
 __do_sys_sendto net/socket.c:2075 [inline]
 __se_sys_sendto net/socket.c:2071 [inline]
 __x64_sys_sendto+0xe5/0x100 net/socket.c:2071
 x64_sys_call+0x178/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88810daf9b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88810daf9c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88810daf9c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                              ^
 ffff88810daf9d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88810daf9d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/18 23:27 android13-5.15-lts 8d934e0056f7 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in seq_printf
* Struck through repros no longer work on HEAD.