syzbot


KASAN: use-after-free Read in process_one_work

Status: auto-obsoleted due to no activity on 2023/07/18 18:33
Reported-by: syzbot+284b84369cf9d8c44148@syzkaller.appspotmail.com
First crash: 594d, last: 594d
Similar bugs (9)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-15 KASAN: use-after-free Read in process_one_work missing-backport origin:downstream C unreliable 445 7h10m 734d 0/2 upstream: reported C repro on 2022/10/31 08:36
android-5-10 BUG: corrupted list in process_one_work C error done 26 4d04h 938d 2/2 upstream: reported C repro on 2022/04/10 06:05
android-6-1 KASAN: use-after-free Read in process_one_work origin:upstream missing-backport C error 587 4h28m 532d 0/2 upstream: reported C repro on 2023/05/21 23:04
upstream KASAN: use-after-free Read in process_one_work 1 2608d 2572d 0/28 closed as invalid on 2018/02/14 13:45
upstream KMSAN: kernel-infoleak in copyout (2) net C 6723 515d 1683d 22/28 fixed on 2023/06/08 14:41
upstream KASAN: global-out-of-bounds Read in process_one_work kernel 1 172d 168d 0/28 auto-obsoleted due to no activity on 2024/08/14 00:54
upstream general protection fault in process_one_work (2) kernel 1 1203d 1199d 0/28 auto-closed as invalid on 2021/09/17 12:34
upstream KASAN: slab-out-of-bounds Read in process_one_work kernel 1 738d 734d 0/28 auto-obsoleted due to no activity on 2023/01/25 20:05
upstream KASAN: slab-use-after-free Read in process_one_work kernel 2 421d 424d 0/28 auto-obsoleted due to no activity on 2023/12/08 17:35

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __list_del_entry_valid+0xa2/0x120 lib/list_debug.c:62
Read of size 8 at addr ffff8881b007cb88 by task kworker/0:3/341

CPU: 0 PID: 341 Comm: kworker/0:3 Not tainted 5.4.225-syzkaller-00007-g2e56f91f9731 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Workqueue: events linkwatch_event
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
 __list_del_entry_valid+0xa2/0x120 lib/list_debug.c:62
 __list_del_entry include/linux/list.h:131 [inline]
 list_del_init include/linux/list.h:190 [inline]
 process_one_work+0x471/0xd20 kernel/workqueue.c:2231
 worker_thread+0xaef/0x1470 kernel/workqueue.c:2433
 kthread+0x2da/0x360 kernel/kthread.c:288
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354

Allocated by task 341:
 save_stack mm/kasan/common.c:70 [inline]
 set_track mm/kasan/common.c:78 [inline]
 __kasan_kmalloc+0x130/0x1d0 mm/kasan/common.c:529
 __kmalloc_node include/linux/slab.h:422 [inline]
 kmalloc_node include/linux/slab.h:599 [inline]
 kvmalloc_node+0x7e/0xf0 mm/util.c:596
 kvmalloc include/linux/mm.h:759 [inline]
 kvzalloc include/linux/mm.h:767 [inline]
 alloc_netdev_mqs+0x85/0xc70 net/core/dev.c:9598
 usbnet_probe+0x1c0/0x27e0 drivers/net/usb/usbnet.c:1687
 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:430
 __device_attach+0x31c/0x490 drivers/base/dd.c:933
 bus_probe_device+0xbd/0x1e0 drivers/base/bus.c:490
 device_add+0x88d/0xbb0 drivers/base/core.c:2908
 usb_set_configuration+0x177e/0x1ce0 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:430
 __device_attach+0x31c/0x490 drivers/base/dd.c:933
 bus_probe_device+0xbd/0x1e0 drivers/base/bus.c:490
 device_add+0x88d/0xbb0 drivers/base/core.c:2908
 usb_new_device+0xbbf/0x1720 drivers/usb/core/hub.c:2563
 hub_port_connect drivers/usb/core/hub.c:5182 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5301 [inline]
 port_event drivers/usb/core/hub.c:5447 [inline]
 hub_event+0x2c01/0x4c50 drivers/usb/core/hub.c:5529
 process_one_work+0x765/0xd20 kernel/workqueue.c:2287
 worker_thread+0xaef/0x1470 kernel/workqueue.c:2433
 kthread+0x2da/0x360 kernel/kthread.c:288
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354

Freed by task 17719:
 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+0x178/0x230 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+0xeb/0x320 mm/slub.c:4071
 device_release+0x6b/0x190 drivers/base/core.c:1776
 kobject_cleanup lib/kobject.c:708 [inline]
 kobject_release lib/kobject.c:739 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x1e6/0x2f0 lib/kobject.c:756
 usb_unbind_interface+0x1d0/0x840 drivers/usb/core/driver.c:423
 __device_release_driver drivers/base/dd.c:1184 [inline]
 device_release_driver_internal+0x50a/0x7b0 drivers/base/dd.c:1216
 bus_remove_device+0x2ca/0x340 drivers/base/bus.c:532
 device_del+0x65a/0xfa0 drivers/base/core.c:3085
 usb_disable_device+0x373/0x690 drivers/usb/core/message.c:1277
 usb_disconnect+0x32c/0x890 drivers/usb/core/hub.c:2226
 hub_port_connect drivers/usb/core/hub.c:5025 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5301 [inline]
 port_event drivers/usb/core/hub.c:5447 [inline]
 hub_event+0x1c34/0x4c50 drivers/usb/core/hub.c:5529
 process_one_work+0x765/0xd20 kernel/workqueue.c:2287
 worker_thread+0xaef/0x1470 kernel/workqueue.c:2433
 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 ffff8881b007c000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 2952 bytes inside of
 4096-byte region [ffff8881b007c000, ffff8881b007d000)
The buggy address belongs to the page:
page:ffffea0006c01e00 refcount:1 mapcount:0 mapping:ffff8881f5c0c280 index:0x0 compound_mapcount: 0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 0000000000000000 0000000200000001 ffff8881f5c0c280
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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL)
 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+0x2ce8/0x2d70 mm/page_alloc.c:3794
 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4891
 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+0x5a/0x90 mm/slub.c:2707
 slab_alloc_node mm/slub.c:2792 [inline]
 slab_alloc mm/slub.c:2837 [inline]
 __kmalloc_track_caller+0x168/0x290 mm/slub.c:4449
 __kmalloc_reserve net/core/skbuff.c:142 [inline]
 __alloc_skb+0xb4/0x4d0 net/core/skbuff.c:210
 alloc_skb include/linux/skbuff.h:1079 [inline]
 nlmsg_new include/net/netlink.h:888 [inline]
 rtmsg_ifinfo_build_skb+0x81/0x180 net/core/rtnetlink.c:3503
 rtmsg_ifinfo_event net/core/rtnetlink.c:3539 [inline]
 rtmsg_ifinfo+0x71/0x120 net/core/rtnetlink.c:3548
 register_netdevice+0xfee/0x12a0 net/core/dev.c:9228
 register_netdev+0x37/0x50 net/core/dev.c:9305
 ip6gre_init_net+0x244/0x310 net/ipv6/ip6_gre.c:1604
 ops_init+0x1d7/0x4e0 net/core/net_namespace.c:138
 setup_net+0x214/0x990 net/core/net_namespace.c:345
page_owner free stack trace missing

Memory state around the buggy address:
 ffff8881b007ca80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881b007cb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881b007cb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff8881b007cc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881b007cc80: 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
2023/03/20 18:32 android12-5.4 2e56f91f9731 7939252e .config console log report info ci2-android-5-4-kasan KASAN: use-after-free Read in process_one_work
* Struck through repros no longer work on HEAD.