syzbot


KASAN: use-after-free Read in input_dev_uevent

Status: auto-obsoleted due to no activity on 2025/06/05 14:59
First crash: 137d, last: 137d
Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-6-1 KASAN: use-after-free Read in input_dev_uevent 19 1 134d 134d 0/2 auto-obsoleted due to no activity on 2025/06/08 06:58
upstream KASAN: slab-use-after-free Read in input_dev_uevent input 19 C done 7 690d 701d 23/29 fixed on 2023/10/12 12:48

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in string_nocheck lib/vsprintf.c:635 [inline]
BUG: KASAN: use-after-free in string+0x24f/0x2f0 lib/vsprintf.c:698
Read of size 1 at addr ffff8881ee9f0ca9 by task udevd/437

CPU: 1 PID: 437 Comm: udevd Not tainted 5.4.290-syzkaller-00017-g6b07fcd94a6a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1d8/0x241 lib/dump_stack.c:118
 print_address_description+0x8c/0x600 mm/kasan/report.c:384
 __kasan_report+0xf3/0x120 mm/kasan/report.c:516
 kasan_report+0x30/0x60 mm/kasan/common.c:653
 string_nocheck lib/vsprintf.c:635 [inline]
 string+0x24f/0x2f0 lib/vsprintf.c:698
 vsnprintf+0x1201/0x1c70 lib/vsprintf.c:2601
 add_uevent_var+0x1c0/0x440 lib/kobject_uevent.c:680
 input_dev_uevent+0x1d8/0x6e0 drivers/input/input.c:1713
 dev_uevent+0x560/0x6f0 drivers/base/core.c:1896
 uevent_show+0x1b3/0x340 drivers/base/core.c:1945
 dev_attr_show+0x50/0xb0 drivers/base/core.c:1647
 sysfs_kf_seq_show+0x265/0x3e0 fs/sysfs/file.c:61
 seq_read+0x4df/0xe60 fs/seq_file.c:232
 __vfs_read+0x103/0x730 fs/read_write.c:425
 vfs_read+0x148/0x360 fs/read_write.c:461
 ksys_read+0x199/0x2c0 fs/read_write.c:587
 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7f790a18ab6a
Code: 00 3d 00 00 41 00 75 0d 50 48 8d 3d 2d 08 0a 00 e8 ea 7d 01 00 31 c0 e9 07 ff ff ff 64 8b 04 25 18 00 00 00 85 c0 75 1b 0f 05 <48> 3d 00 f0 ff ff 76 6c 48 8b 15 8f a2 0d 00 f7 d8 64 89 02 48 83
RSP: 002b:00007ffddbb85768 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00005598eb4a9130 RCX: 00007f790a18ab6a
RDX: 0000000000001000 RSI: 00005598eb4a4640 RDI: 0000000000000008
RBP: 00005598eb4a9130 R08: 0000000000000008 R09: 0000000000000008
R10: 000000000000010f R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000003fff R14: 00007ffddbb85c48 R15: 000000000000000a

Allocated by task 13:
 save_stack mm/kasan/common.c:70 [inline]
 set_track mm/kasan/common.c:78 [inline]
 __kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529
 slab_post_alloc_hook mm/slab.h:584 [inline]
 slab_alloc_node mm/slub.c:2829 [inline]
 slab_alloc mm/slub.c:2837 [inline]
 __kmalloc_track_caller+0x100/0x2b0 mm/slub.c:4449
 alloc_dr drivers/base/devres.c:103 [inline]
 devm_kmalloc+0x34/0x1d0 drivers/base/devres.c:816
 devm_kzalloc include/linux/device.h:953 [inline]
 steam_probe+0x11a/0xa70 drivers/hid/hid-steam.c:741
 hid_device_probe+0x2ac/0x3b0 drivers/hid/hid-core.c:2294
 really_probe+0x496/0xb80 drivers/base/dd.c:567
 driver_probe_device+0xe5/0x240 drivers/base/dd.c:752
 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:432
 __device_attach+0x31c/0x490 drivers/base/dd.c:933
 bus_probe_device+0xbd/0x1e0 drivers/base/bus.c:492
 device_add+0x88d/0xbb0 drivers/base/core.c:2911
 hid_add_device+0x37f/0x4c0 drivers/hid/hid-core.c:2446
 usbhid_probe+0xafd/0xea0 drivers/hid/usbhid/hid-core.c:1418
 usb_probe_interface+0x5aa/0xa90 drivers/usb/core/driver.c:361
 really_probe+0x4dd/0xb80 drivers/base/dd.c:571
 driver_probe_device+0xe5/0x240 drivers/base/dd.c:752
 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:432
 __device_attach+0x31c/0x490 drivers/base/dd.c:933
 bus_probe_device+0xbd/0x1e0 drivers/base/bus.c:492
 device_add+0x88d/0xbb0 drivers/base/core.c:2911
 usb_set_configuration+0x18ce/0x1e30 drivers/usb/core/message.c:2029
 generic_probe+0x84/0x140 drivers/usb/core/generic.c:210
 really_probe+0x4dd/0xb80 drivers/base/dd.c:571
 driver_probe_device+0xe5/0x240 drivers/base/dd.c:752
 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:432
 __device_attach+0x31c/0x490 drivers/base/dd.c:933
 bus_probe_device+0xbd/0x1e0 drivers/base/bus.c:492
 device_add+0x88d/0xbb0 drivers/base/core.c:2911
 usb_new_device+0xbbc/0x1760 drivers/usb/core/hub.c:2581
 hub_port_connect drivers/usb/core/hub.c:5214 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5333 [inline]
 port_event drivers/usb/core/hub.c:5479 [inline]
 hub_event+0x2c62/0x4d50 drivers/usb/core/hub.c:5561
 process_one_work+0x765/0xd20 kernel/workqueue.c:2290
 worker_thread+0xaef/0x1470 kernel/workqueue.c:2436
 kthread+0x2da/0x360 kernel/kthread.c:288
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354

Freed by task 13:
 save_stack mm/kasan/common.c:70 [inline]
 set_track mm/kasan/common.c:78 [inline]
 kasan_set_free_info mm/kasan/common.c:345 [inline]
 __kasan_slab_free+0x1b5/0x270 mm/kasan/common.c:487
 slab_free_hook mm/slub.c:1455 [inline]
 slab_free_freelist_hook mm/slub.c:1494 [inline]
 slab_free mm/slub.c:3080 [inline]
 kfree+0x123/0x370 mm/slub.c:4071
 release_nodes+0x85a/0x8e0 drivers/base/devres.c:508
 __device_release_driver drivers/base/dd.c:1191 [inline]
 device_release_driver_internal+0x519/0x7b0 drivers/base/dd.c:1220
 bus_remove_device+0x2ca/0x340 drivers/base/bus.c:534
 device_del+0x65a/0xfa0 drivers/base/core.c:3088
 hid_remove_device drivers/hid/hid-core.c:2494 [inline]
 hid_destroy_device+0x64/0x100 drivers/hid/hid-core.c:2513
 usbhid_disconnect+0x9a/0xc0 drivers/hid/usbhid/hid-core.c:1445
 usb_unbind_interface+0x1d0/0x840 drivers/usb/core/driver.c:423
 __device_release_driver drivers/base/dd.c:1188 [inline]
 device_release_driver_internal+0x50a/0x7b0 drivers/base/dd.c:1220
 bus_remove_device+0x2ca/0x340 drivers/base/bus.c:534
 device_del+0x65a/0xfa0 drivers/base/core.c:3088
 usb_disable_device+0x38c/0x750 drivers/usb/core/message.c:1277
 usb_disconnect+0x32c/0x890 drivers/usb/core/hub.c:2237
 hub_port_connect drivers/usb/core/hub.c:5057 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5333 [inline]
 port_event drivers/usb/core/hub.c:5479 [inline]
 hub_event+0x1c75/0x4d50 drivers/usb/core/hub.c:5561
 process_one_work+0x765/0xd20 kernel/workqueue.c:2290
 process_scheduled_works kernel/workqueue.c:2352 [inline]
 worker_thread+0xe02/0x1470 kernel/workqueue.c:2438
 kthread+0x2da/0x360 kernel/kthread.c:288
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354

The buggy address belongs to the object at ffff8881ee9f0c00
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 169 bytes inside of
 512-byte region [ffff8881ee9f0c00, ffff8881ee9f0e00)
The buggy address belongs to the page:
page:ffffea0007ba7c00 refcount:1 mapcount:0 mapping:ffff8881f5c02500 index:0x0 compound_mapcount: 0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c02500
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)
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook mm/page_alloc.c:2165 [inline]
 prep_new_page+0x18f/0x370 mm/page_alloc.c:2171
 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794
 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893
 alloc_slab_page+0x39/0x3c0 mm/slub.c:343
 allocate_slab mm/slub.c:1683 [inline]
 new_slab+0x97/0x440 mm/slub.c:1749
 new_slab_objects mm/slub.c:2505 [inline]
 ___slab_alloc+0x2fe/0x490 mm/slub.c:2667
 __slab_alloc+0x62/0xa0 mm/slub.c:2707
 slab_alloc_node mm/slub.c:2792 [inline]
 slab_alloc mm/slub.c:2837 [inline]
 kmem_cache_alloc_trace+0x12d/0x260 mm/slub.c:2854
 kmalloc include/linux/slab.h:556 [inline]
 kzalloc include/linux/slab.h:690 [inline]
 inetdev_init+0x7e/0x450 net/ipv4/devinet.c:259
 inetdev_event+0x205/0x1040 net/ipv4/devinet.c:1544
 notifier_call_chain kernel/notifier.c:98 [inline]
 __raw_notifier_call_chain kernel/notifier.c:399 [inline]
 raw_notifier_call_chain+0x95/0x110 kernel/notifier.c:406
 call_netdevice_notifiers_info net/core/dev.c:1670 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:1682 [inline]
 call_netdevice_notifiers net/core/dev.c:1696 [inline]
 register_netdevice+0xeef/0x12a0 net/core/dev.c:9240
 veth_newlink+0x667/0xb50 drivers/net/veth.c:1302
 __rtnl_newlink net/core/rtnetlink.c:3255 [inline]
 rtnl_newlink+0x1567/0x2060 net/core/rtnetlink.c:3314
 rtnetlink_rcv_msg+0x983/0xc70 net/core/rtnetlink.c:5290
 netlink_rcv_skb+0x1d5/0x420 net/netlink/af_netlink.c:2467
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1176 [inline]
 __free_pages_ok+0x847/0x950 mm/page_alloc.c:1438
 free_the_page mm/page_alloc.c:4955 [inline]
 __free_pages mm/page_alloc.c:4961 [inline]
 free_pages+0xf6/0x1b0 mm/page_alloc.c:4969
 stack_depot_save+0x42b/0x480 lib/stackdepot.c:300
 save_stack mm/kasan/common.c:72 [inline]
 set_track mm/kasan/common.c:78 [inline]
 __kasan_kmalloc+0x1d9/0x210 mm/kasan/common.c:529
 slab_post_alloc_hook mm/slab.h:584 [inline]
 slab_alloc_node mm/slub.c:2829 [inline]
 slab_alloc mm/slub.c:2837 [inline]
 __kmalloc+0x105/0x2e0 mm/slub.c:3909
 kmalloc include/linux/slab.h:561 [inline]
 kzalloc include/linux/slab.h:690 [inline]
 tnode_alloc net/ipv4/fib_trie.c:334 [inline]
 tnode_new net/ipv4/fib_trie.c:387 [inline]
 inflate net/ipv4/fib_trie.c:547 [inline]
 resize+0x2e2/0x25b0 net/ipv4/fib_trie.c:871
 trie_rebalance net/ipv4/fib_trie.c:1011 [inline]
 fib_insert_node net/ipv4/fib_trie.c:1055 [inline]
 fib_insert_alias+0xa7c/0xf80 net/ipv4/fib_trie.c:1072
 fib_table_insert+0x9a3/0x19b0 net/ipv4/fib_trie.c:1275
 fib_magic net/ipv4/fib_frontend.c:1103 [inline]
 fib_add_ifaddr+0x42c/0x1a40 net/ipv4/fib_frontend.c:1125
 fib_inetaddr_event+0x12b/0x2b0 net/ipv4/fib_frontend.c:1441
 notifier_call_chain kernel/notifier.c:98 [inline]
 __blocking_notifier_call_chain kernel/notifier.c:322 [inline]
 blocking_notifier_call_chain+0xd5/0x160 kernel/notifier.c:333
 __inet_insert_ifa+0x907/0xb50 net/ipv4/devinet.c:568
 inet_rtm_newaddr+0x8f1/0x16a0 net/ipv4/devinet.c:968
 rtnetlink_rcv_msg+0x983/0xc70 net/core/rtnetlink.c:5290
 netlink_rcv_skb+0x1d5/0x420 net/netlink/af_netlink.c:2467
 netlink_unicast_kernel net/netlink/af_netlink.c:1306 [inline]
 netlink_unicast+0x936/0xb20 net/netlink/af_netlink.c:1332

Memory state around the buggy address:
 ffff8881ee9f0b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881ee9f0c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881ee9f0c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff8881ee9f0d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881ee9f0d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
hid 0003:28DE:1102.0003: No HID_FEATURE_REPORT submitted -  nothing to read
hid 0003:28DE:1102.0003: No HID_FEATURE_REPORT submitted -  nothing to read
hid 0003:28DE:1102.0003: No HID_FEATURE_REPORT submitted -  nothing to read
hid 0003:28DE:1102.0003: No HID_FEATURE_REPORT submitted -  nothing to read
hid 0003:28DE:1102.0003: No HID_FEATURE_REPORT submitted -  nothing to read

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/03/07 14:54 android12-5.4 6b07fcd94a6a 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in input_dev_uevent
* Struck through repros no longer work on HEAD.