syzbot


KASAN: use-after-free Read in worker_thread

Status: upstream: reported C repro on 2023/06/14 05:51
Bug presence: origin:lts
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+1e040fdc8378f9772fe3@syzkaller.appspotmail.com
First crash: 375d, last: 7d06h
Cause bisection: failed (error log, bisect log)
  
Bug presence (2)
Date Name Commit Repro Result
2023/08/31 lts (merge base) b1644a0031cf C [report] KASAN: use-after-free Read in worker_thread
2023/08/31 upstream (ToT) b97d64c72259 C Didn't crash
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-15 KASAN: use-after-free Read in worker_thread missing-backport origin:downstream C unreliable error 27 6d14h 581d 0/2 upstream: reported C repro on 2022/10/16 06:28
upstream KASAN: use-after-free Read in worker_thread (2) net syz 6 2375d 2384d 5/26 fixed on 2018/04/06 16:37
upstream KASAN: use-after-free Read in worker_thread 2 2439d 2396d 0/26 closed as invalid on 2017/10/27 09:33
upstream general protection fault in worker_thread kernel 1 596d 592d 0/26 auto-obsoleted due to no activity on 2022/12/30 10:32
upstream KMSAN: uninit-value in worker_thread (3) ext4 2 961d 1044d 0/26 auto-closed as invalid on 2021/12/30 14:37
upstream general protection fault in worker_thread (2) io-uring syz 1 333d 329d 0/26 auto-obsoleted due to no activity on 2023/09/29 13:47
Last patch testing requests (7)
Created Duration User Patch Repo Result
2024/03/08 02:48 13m retest repro android14-6.1 report log
2024/03/08 02:48 8m retest repro android14-6.1 report log
2024/03/08 02:48 55m retest repro android14-6.1 report log
2024/02/26 17:09 7m retest repro android14-6.1 report log
2024/02/12 11:56 20m retest repro android14-6.1 report log
2024/01/29 11:24 9m retest repro android14-6.1 report log
2023/12/29 01:53 11m retest repro android14-6.1 report log
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/12/10 13:21 1h18m bisect fix android14-6.1 job log (0) log
2023/09/10 14:44 1h38m bisect fix android14-6.1 job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in worker_thread+0xa36/0x1260 kernel/workqueue.c:2444
Read of size 8 at addr ffff88811c80cce0 by task kworker/0:7/323

CPU: 0 PID: 323 Comm: kworker/0:7 Not tainted 6.1.75-syzkaller-00074-g4744b3a4ed72 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue:  0x0 (events)
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0x158/0x4e0 mm/kasan/report.c:427
 kasan_report+0x13c/0x170 mm/kasan/report.c:531
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:351
 worker_thread+0xa36/0x1260 kernel/workqueue.c:2444
 kthread+0x26d/0x300 kernel/kthread.c:386
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
 </TASK>

Allocated by task 313:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505
 ____kasan_kmalloc mm/kasan/common.c:379 [inline]
 __kasan_kmalloc+0x9c/0xb0 mm/kasan/common.c:388
 kasan_kmalloc include/linux/kasan.h:212 [inline]
 __do_kmalloc_node mm/slab_common.c:957 [inline]
 __kmalloc_node+0xb4/0x1e0 mm/slab_common.c:964
 kmalloc_node include/linux/slab.h:579 [inline]
 kvmalloc_node+0x221/0x640 mm/util.c:592
 kvmalloc include/linux/slab.h:706 [inline]
 kvzalloc include/linux/slab.h:714 [inline]
 alloc_netdev_mqs+0x8c/0xf90 net/core/dev.c:10626
 alloc_etherdev_mqs+0x36/0x40 net/ethernet/eth.c:394
 usbnet_probe+0x207/0x27c0 drivers/net/usb/usbnet.c:1693
 usb_probe_interface+0x5b6/0xa90 drivers/usb/core/driver.c:397
 really_probe+0x2b8/0x920 drivers/base/dd.c:639
 __driver_probe_device+0x1a0/0x310 drivers/base/dd.c:808
 driver_probe_device+0x54/0x3d0 drivers/base/dd.c:838
 __device_attach_driver+0x2e3/0x490 drivers/base/dd.c:966
 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427
 __device_attach+0x312/0x510 drivers/base/dd.c:1038
 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1087
 bus_probe_device+0xbe/0x1e0 drivers/base/bus.c:487
 device_add+0xb60/0xf10 drivers/base/core.c:3664
 usb_set_configuration+0x190f/0x1e80 drivers/usb/core/message.c:2165
 usb_generic_driver_probe+0x8b/0x150 drivers/usb/core/generic.c:238
 usb_probe_device+0x144/0x260 drivers/usb/core/driver.c:294
 really_probe+0x2b8/0x920 drivers/base/dd.c:639
 __driver_probe_device+0x1a0/0x310 drivers/base/dd.c:808
 driver_probe_device+0x54/0x3d0 drivers/base/dd.c:838
 __device_attach_driver+0x2e3/0x490 drivers/base/dd.c:966
 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427
 __device_attach+0x312/0x510 drivers/base/dd.c:1038
 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1087
 bus_probe_device+0xbe/0x1e0 drivers/base/bus.c:487
 device_add+0xb60/0xf10 drivers/base/core.c:3664
 usb_new_device+0xf32/0x1810 drivers/usb/core/hub.c:2608
 hub_port_connect drivers/usb/core/hub.c:5511 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5651 [inline]
 port_event drivers/usb/core/hub.c:5811 [inline]
 hub_event+0x2db1/0x4830 drivers/usb/core/hub.c:5893
 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2299
 process_scheduled_works kernel/workqueue.c:2362 [inline]
 worker_thread+0xd71/0x1260 kernel/workqueue.c:2448
 kthread+0x26d/0x300 kernel/kthread.c:386
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306

Freed by task 313:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:241
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249
 kasan_slab_free include/linux/kasan.h:178 [inline]
 slab_free_hook mm/slub.c:1745 [inline]
 slab_free_freelist_hook mm/slub.c:1771 [inline]
 slab_free mm/slub.c:3684 [inline]
 __kmem_cache_free+0x218/0x3b0 mm/slub.c:3697
 kfree+0x7a/0xf0 mm/slab_common.c:1009
 kvfree+0x35/0x40 mm/util.c:639
 netdev_freemem+0x3f/0x60 net/core/dev.c:10580
 netdev_release+0x7f/0xb0 net/core/net-sysfs.c:1906
 device_release+0x95/0x1c0
 kobject_cleanup lib/kobject.c:681 [inline]
 kobject_release lib/kobject.c:712 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x178/0x260 lib/kobject.c:729
 put_device+0x1f/0x30 drivers/base/core.c:3772
 free_netdev+0x393/0x480 net/core/dev.c:10773
 usbnet_disconnect+0x245/0x390 drivers/net/usb/usbnet.c:1632
 usb_unbind_interface+0x1fa/0x8c0 drivers/usb/core/driver.c:459
 device_remove drivers/base/dd.c:550 [inline]
 __device_release_driver drivers/base/dd.c:1283 [inline]
 device_release_driver_internal+0x53e/0x870 drivers/base/dd.c:1309
 device_release_driver+0x19/0x20 drivers/base/dd.c:1332
 bus_remove_device+0x2fa/0x360 drivers/base/bus.c:529
 device_del+0x663/0xe90 drivers/base/core.c:3852
 usb_disable_device+0x380/0x720 drivers/usb/core/message.c:1414
 usb_disconnect+0x32a/0x890 drivers/usb/core/hub.c:2271
 hub_port_connect drivers/usb/core/hub.c:5350 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5651 [inline]
 port_event drivers/usb/core/hub.c:5811 [inline]
 hub_event+0x1ed8/0x4830 drivers/usb/core/hub.c:5893
 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2299
 process_scheduled_works kernel/workqueue.c:2362 [inline]
 worker_thread+0xd71/0x1260 kernel/workqueue.c:2448
 kthread+0x26d/0x300 kernel/kthread.c:386
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306

Last potentially related work creation:
 kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb4/0xc0 mm/kasan/generic.c:486
 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:496
 insert_work+0x56/0x310 kernel/workqueue.c:1368
 __queue_work+0x9b6/0xd70 kernel/workqueue.c:1527
 queue_work_on+0x105/0x170 kernel/workqueue.c:1555
 usbnet_link_change+0xeb/0x100
 usbnet_probe+0x1dbe/0x27c0 drivers/net/usb/usbnet.c:1840
 usb_probe_interface+0x5b6/0xa90 drivers/usb/core/driver.c:397
 really_probe+0x2b8/0x920 drivers/base/dd.c:639
 __driver_probe_device+0x1a0/0x310 drivers/base/dd.c:808
 driver_probe_device+0x54/0x3d0 drivers/base/dd.c:838
 __device_attach_driver+0x2e3/0x490 drivers/base/dd.c:966
 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427
 __device_attach+0x312/0x510 drivers/base/dd.c:1038
 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1087
 bus_probe_device+0xbe/0x1e0 drivers/base/bus.c:487
 device_add+0xb60/0xf10 drivers/base/core.c:3664
 usb_set_configuration+0x190f/0x1e80 drivers/usb/core/message.c:2165
 usb_generic_driver_probe+0x8b/0x150 drivers/usb/core/generic.c:238
 usb_probe_device+0x144/0x260 drivers/usb/core/driver.c:294
 really_probe+0x2b8/0x920 drivers/base/dd.c:639
 __driver_probe_device+0x1a0/0x310 drivers/base/dd.c:808
 driver_probe_device+0x54/0x3d0 drivers/base/dd.c:838
 __device_attach_driver+0x2e3/0x490 drivers/base/dd.c:966
 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427
 __device_attach+0x312/0x510 drivers/base/dd.c:1038
 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1087
 bus_probe_device+0xbe/0x1e0 drivers/base/bus.c:487
 device_add+0xb60/0xf10 drivers/base/core.c:3664
 usb_new_device+0xf32/0x1810 drivers/usb/core/hub.c:2608
 hub_port_connect drivers/usb/core/hub.c:5511 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5651 [inline]
 port_event drivers/usb/core/hub.c:5811 [inline]
 hub_event+0x2db1/0x4830 drivers/usb/core/hub.c:5893
 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2299
 process_scheduled_works kernel/workqueue.c:2362 [inline]
 worker_thread+0xd71/0x1260 kernel/workqueue.c:2448
 kthread+0x26d/0x300 kernel/kthread.c:386
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306

The buggy address belongs to the object at ffff88811c80c000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 3296 bytes inside of
 4096-byte region [ffff88811c80c000, ffff88811c80d000)

The buggy address belongs to the physical page:
page:ffffea0004720200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11c808
head:ffffea0004720200 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 ffffea000485ea00 dead000000000002 ffff888100043380
raw: 0000000000000000 0000000000040004 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 227, tgid 227 (sshd), ts 12092132478, free_ts 0
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590
 prep_new_page+0x1b/0x110 mm/page_alloc.c:2597
 get_page_from_freelist+0x27ea/0x2870 mm/page_alloc.c:4425
 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5712
 alloc_slab_page+0x6c/0xf0
 allocate_slab mm/slub.c:1962 [inline]
 new_slab+0x90/0x3e0 mm/slub.c:2015
 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3203
 __slab_alloc+0x5d/0xa0 mm/slub.c:3302
 slab_alloc_node mm/slub.c:3387 [inline]
 __kmem_cache_alloc_node+0x1af/0x250 mm/slub.c:3460
 __do_kmalloc_node mm/slab_common.c:956 [inline]
 __kmalloc_node_track_caller+0xa2/0x1e0 mm/slab_common.c:977
 kmalloc_reserve net/core/skbuff.c:446 [inline]
 __alloc_skb+0x125/0x2d0 net/core/skbuff.c:515
 alloc_skb include/linux/skbuff.h:1283 [inline]
 netlink_dump+0x2c9/0xd20 net/netlink/af_netlink.c:2214
 __netlink_dump_start+0x637/0x820 net/netlink/af_netlink.c:2345
 netlink_dump_start include/linux/netlink.h:269 [inline]
 rtnetlink_rcv_msg+0xb7f/0xca0 net/core/rtnetlink.c:6078
 netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2518
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6140
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88811c80cb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88811c80cc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88811c80cc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                       ^
 ffff88811c80cd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88811c80cd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (23):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/30 09:19 android14-6.1 4744b3a4ed72 f10afd69 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/04/15 06:48 android14-6.1 b76ed1185975 c8349e48 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/01/15 11:24 android14-6.1 66cd99ccdbea 551587c1 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2023/10/27 10:25 android14-6.1 35361bdac25a bf285f0c .config strace log report syz C [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2023/09/24 03:39 android14-6.1 060ebb378d1c 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2023/09/11 06:57 android14-6.1 cd94fe67fd33 6654cf89 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2023/06/14 05:44 android14-6.1 71761b36c37a d2ee9228 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2023/05/15 14:44 android14-6.1 81509f85f33a c4d362e7 .config strace log report syz [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/05/12 12:48 android14-6.1 4d55129aea65 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/05/10 14:40 android14-6.1 4d55129aea65 f7c35481 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/04/26 20:54 android14-6.1 fa87a072a7fc 059e9963 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/04/24 07:56 android14-6.1 d0c6724b0f6f 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/04/20 18:11 android14-6.1 dcb09569bbff af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/04/17 12:16 android14-6.1 089d1b8f6daf 18f6e127 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/04/13 14:14 android14-6.1 cfa154389a65 c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/04/11 13:05 android14-6.1 be55946e207c 33b9e058 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/04/04 20:08 android14-6.1 60534eef4739 0ee3535e .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/03/18 05:55 android14-6.1 ef39f76e4d24 d615901c .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/03/17 17:00 android14-6.1 ef39f76e4d24 d615901c .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/03/14 13:41 android14-6.1 ef39f76e4d24 8d8ee116 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2024/03/12 18:44 android14-6.1 bb197cebd544 c35c26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2023/12/15 01:47 android14-6.1 cc294d9503f8 3222d10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
2023/05/10 11:37 android14-6.1 dac17bb8f7c1 14b12a99 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in worker_thread
* Struck through repros no longer work on HEAD.