KASAN: use-after-free Read in process_one_work

8 views
Skip to first unread message

syzbot

unread,
Oct 31, 2022, 4:36:40 AM10/31/22
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7f2e600bf63a Merge 5.15.74 into android13-5.15-lts
git tree: android13-5.15-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=17ee21b6880000
kernel config: https://syzkaller.appspot.com/x/.config?x=793f6fcecb4c5b08
dashboard link: https://syzkaller.appspot.com/bug?extid=3512b5042ccf76dc6152
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1601d5b6880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11dc42ea880000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/79a248fb2d4a/disk-7f2e600b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8e350ccd91cf/vmlinux-7f2e600b.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+3512b5...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in __list_del_entry_valid+0xaa/0x130 lib/list_debug.c:62
Read of size 8 at addr ffff88810afd0c70 by task kworker/1:8/528

CPU: 1 PID: 528 Comm: kworker/1:8 Not tainted 5.15.74-syzkaller-04383-g7f2e600bf63a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022
Workqueue: events kfree_rcu_work
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
print_address_description+0x87/0x3d0 mm/kasan/report.c:256
__kasan_report mm/kasan/report.c:435 [inline]
kasan_report+0x1a6/0x1f0 mm/kasan/report.c:452
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
__list_del_entry_valid+0xaa/0x130 lib/list_debug.c:62
__list_del_entry include/linux/list.h:132 [inline]
list_del_init include/linux/list.h:204 [inline]
process_one_work+0x45b/0xc00 kernel/workqueue.c:2257
worker_thread+0xb3e/0x1340 kernel/workqueue.c:2460
kthread+0x41c/0x500 kernel/kthread.c:319
ret_from_fork+0x1f/0x30
</TASK>

Allocated by task 519:
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+0xdc/0x110 mm/kasan/common.c:512
__kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521
kasan_kmalloc include/linux/kasan.h:254 [inline]
__kmalloc+0x203/0x350 mm/slub.c:4423
__kmalloc_node include/linux/slab.h:457 [inline]
kmalloc_node include/linux/slab.h:614 [inline]
kvmalloc_node+0x82/0x130 mm/util.c:623
kvmalloc include/linux/mm.h:844 [inline]
kvzalloc include/linux/mm.h:852 [inline]
alloc_netdev_mqs+0x8c/0xc80 net/core/dev.c:10828
alloc_etherdev_mqs+0x33/0x40 net/ethernet/eth.c:393
usbnet_probe+0x1c2/0x2750 drivers/net/usb/usbnet.c:1694
usb_probe_interface+0x632/0xae0 drivers/usb/core/driver.c:396
really_probe+0x28d/0x970 drivers/base/dd.c:595
__driver_probe_device+0x1b7/0x290 drivers/base/dd.c:750
driver_probe_device+0x54/0x3d0 drivers/base/dd.c:780
__device_attach_driver+0x2bf/0x470 drivers/base/dd.c:902
bus_for_each_drv+0x18a/0x210 drivers/base/bus.c:427
__device_attach+0x32b/0x530 drivers/base/dd.c:974
device_initial_probe+0x1a/0x20 drivers/base/dd.c:1023
bus_probe_device+0xbc/0x1f0 drivers/base/bus.c:487
device_add+0xb1e/0xef0 drivers/base/core.c:3404
usb_set_configuration+0x1a91/0x2020 drivers/usb/core/message.c:2170
usb_generic_driver_probe+0x89/0x150 drivers/usb/core/generic.c:238
usb_probe_device+0x140/0x240 drivers/usb/core/driver.c:293
really_probe+0x28d/0x970 drivers/base/dd.c:595
__driver_probe_device+0x1b7/0x290 drivers/base/dd.c:750
driver_probe_device+0x54/0x3d0 drivers/base/dd.c:780
__device_attach_driver+0x2bf/0x470 drivers/base/dd.c:902
bus_for_each_drv+0x18a/0x210 drivers/base/bus.c:427
__device_attach+0x32b/0x530 drivers/base/dd.c:974
device_initial_probe+0x1a/0x20 drivers/base/dd.c:1023
bus_probe_device+0xbc/0x1f0 drivers/base/bus.c:487
device_add+0xb1e/0xef0 drivers/base/core.c:3404
usb_new_device+0x1012/0x1ba0 drivers/usb/core/hub.c:2572
hub_port_connect drivers/usb/core/hub.c:5362 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5506 [inline]
port_event drivers/usb/core/hub.c:5652 [inline]
hub_event+0x2c85/0x5160 drivers/usb/core/hub.c:5734
process_one_work+0x6db/0xc00 kernel/workqueue.c:2313
process_scheduled_works kernel/workqueue.c:2376 [inline]
worker_thread+0xe94/0x1340 kernel/workqueue.c:2462
kthread+0x41c/0x500 kernel/kthread.c:319
ret_from_fork+0x1f/0x30

Freed by task 519:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4c/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:373
kasan_slab_free include/linux/kasan.h:220 [inline]
slab_free_hook mm/slub.c:1721 [inline]
slab_free_freelist_hook+0xc9/0x1a0 mm/slub.c:1747
slab_free mm/slub.c:3515 [inline]
kfree+0xc8/0x210 mm/slub.c:4575
kvfree+0x35/0x40 mm/util.c:658
netdev_freemem+0x3e/0x60 net/core/dev.c:10782
netdev_release+0x79/0xa0 net/core/net-sysfs.c:1903
device_release+0x9c/0x1d0
kobject_cleanup lib/kobject.c:705 [inline]
kobject_release lib/kobject.c:736 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x163/0x240 lib/kobject.c:753
put_device+0x1f/0x30 drivers/base/core.c:3511
free_netdev+0x365/0x450 net/core/dev.c:10968
usbnet_disconnect+0x277/0x3b0 drivers/net/usb/usbnet.c:1633
usb_unbind_interface+0x20f/0x8e0 drivers/usb/core/driver.c:458
__device_release_driver drivers/base/dd.c:1220 [inline]
device_release_driver_internal+0x528/0x7e0 drivers/base/dd.c:1253
device_release_driver+0x19/0x20 drivers/base/dd.c:1276
bus_remove_device+0x2de/0x340 drivers/base/bus.c:529
device_del+0x64e/0xec0 drivers/base/core.c:3591
usb_disable_device+0x3a4/0x710 drivers/usb/core/message.c:1419
usb_disconnect+0x342/0x880 drivers/usb/core/hub.c:2229
hub_port_connect drivers/usb/core/hub.c:5206 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5506 [inline]
port_event drivers/usb/core/hub.c:5652 [inline]
hub_event+0x1d59/0x5160 drivers/usb/core/hub.c:5734
process_one_work+0x6db/0xc00 kernel/workqueue.c:2313
process_scheduled_works kernel/workqueue.c:2376 [inline]
worker_thread+0xe94/0x1340 kernel/workqueue.c:2462
kthread+0x41c/0x500 kernel/kthread.c:319
ret_from_fork+0x1f/0x30

Last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348
kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
insert_work+0x56/0x340 kernel/workqueue.c:1369
__queue_work+0x934/0xcf0 kernel/workqueue.c:1535
queue_work_on+0xf2/0x170 kernel/workqueue.c:1562
usbnet_link_change+0xe6/0x100
usbnet_probe+0x1cf3/0x2750 drivers/net/usb/usbnet.c:1835
usb_probe_interface+0x632/0xae0 drivers/usb/core/driver.c:396
really_probe+0x28d/0x970 drivers/base/dd.c:595
__driver_probe_device+0x1b7/0x290 drivers/base/dd.c:750
driver_probe_device+0x54/0x3d0 drivers/base/dd.c:780
__device_attach_driver+0x2bf/0x470 drivers/base/dd.c:902
bus_for_each_drv+0x18a/0x210 drivers/base/bus.c:427
__device_attach+0x32b/0x530 drivers/base/dd.c:974
device_initial_probe+0x1a/0x20 drivers/base/dd.c:1023
bus_probe_device+0xbc/0x1f0 drivers/base/bus.c:487
device_add+0xb1e/0xef0 drivers/base/core.c:3404
usb_set_configuration+0x1a91/0x2020 drivers/usb/core/message.c:2170
usb_generic_driver_probe+0x89/0x150 drivers/usb/core/generic.c:238
usb_probe_device+0x140/0x240 drivers/usb/core/driver.c:293
really_probe+0x28d/0x970 drivers/base/dd.c:595
__driver_probe_device+0x1b7/0x290 drivers/base/dd.c:750
driver_probe_device+0x54/0x3d0 drivers/base/dd.c:780
__device_attach_driver+0x2bf/0x470 drivers/base/dd.c:902
bus_for_each_drv+0x18a/0x210 drivers/base/bus.c:427
__device_attach+0x32b/0x530 drivers/base/dd.c:974
device_initial_probe+0x1a/0x20 drivers/base/dd.c:1023
bus_probe_device+0xbc/0x1f0 drivers/base/bus.c:487
device_add+0xb1e/0xef0 drivers/base/core.c:3404
usb_new_device+0x1012/0x1ba0 drivers/usb/core/hub.c:2572
hub_port_connect drivers/usb/core/hub.c:5362 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5506 [inline]
port_event drivers/usb/core/hub.c:5652 [inline]
hub_event+0x2c85/0x5160 drivers/usb/core/hub.c:5734
process_one_work+0x6db/0xc00 kernel/workqueue.c:2313
process_scheduled_works kernel/workqueue.c:2376 [inline]
worker_thread+0xe94/0x1340 kernel/workqueue.c:2462
kthread+0x41c/0x500 kernel/kthread.c:319
ret_from_fork+0x1f/0x30

The buggy address belongs to the object at ffff88810afd0000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 3184 bytes inside of
4096-byte region [ffff88810afd0000, ffff88810afd1000)
The buggy address belongs to the page:
page:ffffea00042bf400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10afd0
head:ffffea00042bf400 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 dead000000000100 dead000000000122 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 1, ts 1801283316, free_ts 0
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1ab/0x1b0 mm/page_alloc.c:2495
prep_new_page mm/page_alloc.c:2501 [inline]
get_page_from_freelist+0x38b/0x400 mm/page_alloc.c:4281
__alloc_pages+0x3a8/0x7c0 mm/page_alloc.c:5548
allocate_slab+0x62/0x580 mm/slub.c:1928
new_slab mm/slub.c:1991 [inline]
___slab_alloc+0x2e2/0x6f0 mm/slub.c:3024
__slab_alloc+0x4a/0x90 mm/slub.c:3111
slab_alloc_node mm/slub.c:3202 [inline]
slab_alloc mm/slub.c:3244 [inline]
kmem_cache_alloc_trace+0x214/0x310 mm/slub.c:3261
kmalloc include/linux/slab.h:591 [inline]
kzalloc include/linux/slab.h:721 [inline]
kobject_uevent_env+0x26c/0x730 lib/kobject_uevent.c:524
kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:642
driver_register+0x3c1/0x410 drivers/base/driver.c:179
register_virtio_driver+0x96/0xc0 drivers/virtio/virtio.c:325
init+0x66/0xe0 drivers/scsi/virtio_scsi.c:1009
do_one_initcall+0x1b5/0x600 init/main.c:1306
do_initcall_level+0x192/0x2f0 init/main.c:1379
do_initcalls+0x50/0x94 init/main.c:1395
do_basic_setup+0x81/0x8a init/main.c:1414
page_owner free stack trace missing

Memory state around the buggy address:
ffff88810afd0b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88810afd0b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88810afd0c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88810afd0c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88810afd0d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

Jun Nie

unread,
Dec 6, 2022, 2:08:30 AM12/6/22
to syzkaller-android-bugs

syzbot

unread,
Dec 6, 2022, 9:04:43 AM12/6/22
to jun...@linaro.org, syzkaller-a...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: use-after-free Read in worker_thread

==================================================================
BUG: KASAN: use-after-free in worker_thread+0xb0e/0x1390 kernel/workqueue.c:2434
Read of size 8 at addr ffff8881162cab30 by task kworker/0:6/785

CPU: 0 PID: 785 Comm: kworker/0:6 Not tainted 6.1.0-rc8-syzkaller-00003-gbce9332220bd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Workqueue: 0x0 (pm)
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:284 [inline]
print_report+0x164/0x510 mm/kasan/report.c:395
kasan_report+0x13f/0x170 mm/kasan/report.c:495
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:351
worker_thread+0xb0e/0x1390 kernel/workqueue.c:2434
kthread+0x26b/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
</TASK>

Allocated by task 19:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x70 mm/kasan/common.c:52
kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:500
____kasan_kmalloc mm/kasan/common.c:371 [inline]
__kasan_kmalloc+0x9c/0xb0 mm/kasan/common.c:380
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:955 [inline]
__kmalloc_node+0xb0/0x1e0 mm/slab_common.c:962
kmalloc_node include/linux/slab.h:579 [inline]
kvmalloc_node+0x72/0x190 mm/util.c:581
kvmalloc include/linux/slab.h:706 [inline]
kvzalloc include/linux/slab.h:714 [inline]
alloc_netdev_mqs+0x8c/0xd50 net/core/dev.c:10588
alloc_etherdev_mqs+0x36/0x40 net/ethernet/eth.c:394
usbnet_probe+0x186/0x2580 drivers/net/usb/usbnet.c:1693
usb_probe_interface+0x632/0xae0 drivers/usb/core/driver.c:396
really_probe+0x2af/0x910 drivers/base/dd.c:639
__driver_probe_device+0x1b4/0x280 drivers/base/dd.c:778
driver_probe_device+0x54/0x3d0 drivers/base/dd.c:808
__device_attach_driver+0x2dd/0x490 drivers/base/dd.c:936
bus_for_each_drv+0x18a/0x210 drivers/base/bus.c:427
__device_attach+0x322/0x530 drivers/base/dd.c:1008
device_initial_probe+0x1a/0x20 drivers/base/dd.c:1057
bus_probe_device+0xb9/0x1e0 drivers/base/bus.c:487
device_add+0xb15/0xed0 drivers/base/core.c:3517
usb_set_configuration+0x1a91/0x2010 drivers/usb/core/message.c:2170
usb_generic_driver_probe+0x89/0x150 drivers/usb/core/generic.c:238
usb_probe_device+0x13a/0x240 drivers/usb/core/driver.c:293
really_probe+0x2af/0x910 drivers/base/dd.c:639
__driver_probe_device+0x1b4/0x280 drivers/base/dd.c:778
driver_probe_device+0x54/0x3d0 drivers/base/dd.c:808
__device_attach_driver+0x2dd/0x490 drivers/base/dd.c:936
bus_for_each_drv+0x18a/0x210 drivers/base/bus.c:427
__device_attach+0x322/0x530 drivers/base/dd.c:1008
device_initial_probe+0x1a/0x20 drivers/base/dd.c:1057
bus_probe_device+0xb9/0x1e0 drivers/base/bus.c:487
device_add+0xb15/0xed0 drivers/base/core.c:3517
usb_new_device+0xba4/0x1770 drivers/usb/core/hub.c:2573
hub_port_connect drivers/usb/core/hub.c:5353 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5497 [inline]
port_event drivers/usb/core/hub.c:5653 [inline]
hub_event+0x2c36/0x5020 drivers/usb/core/hub.c:5735
process_one_work+0x6cb/0xc00 kernel/workqueue.c:2289
worker_thread+0xb3c/0x1390 kernel/workqueue.c:2436
kthread+0x26b/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306

Freed by task 19:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:511
____kasan_slab_free+0x131/0x180 mm/kasan/common.c:236
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:244
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook+0xc9/0x1a0 mm/slub.c:1750
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0xbb/0x160 mm/slub.c:3674
kfree+0x7a/0xf0 mm/slab_common.c:1007
kvfree+0x35/0x40 mm/util.c:627
netdev_freemem+0x3e/0x60 net/core/dev.c:10542
netdev_release+0x79/0xa0 net/core/net-sysfs.c:1910
device_release+0x9c/0x1d0
kobject_cleanup lib/kobject.c:673 [inline]
kobject_release lib/kobject.c:704 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x163/0x240 lib/kobject.c:721
put_device+0x1f/0x30 drivers/base/core.c:3624
free_netdev+0x3a6/0x490 net/core/dev.c:10735
usbnet_disconnect+0x267/0x3a0 drivers/net/usb/usbnet.c:1632
usb_unbind_interface+0x206/0x8d0 drivers/usb/core/driver.c:458
device_remove drivers/base/dd.c:550 [inline]
__device_release_driver drivers/base/dd.c:1249 [inline]
device_release_driver_internal+0x548/0x870 drivers/base/dd.c:1275
device_release_driver+0x19/0x20 drivers/base/dd.c:1298
bus_remove_device+0x2c7/0x330 drivers/base/bus.c:529
device_del+0x618/0xe90 drivers/base/core.c:3704
usb_disable_device+0x3a4/0x710 drivers/usb/core/message.c:1419
usb_disconnect+0x342/0x880 drivers/usb/core/hub.c:2235
hub_port_connect drivers/usb/core/hub.c:5197 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5497 [inline]
port_event drivers/usb/core/hub.c:5653 [inline]
hub_event+0x1f1d/0x5020 drivers/usb/core/hub.c:5735
process_one_work+0x6cb/0xc00 kernel/workqueue.c:2289
process_scheduled_works kernel/workqueue.c:2352 [inline]
worker_thread+0xe64/0x1390 kernel/workqueue.c:2438
kthread+0x26b/0x300 kernel/kthread.c:376
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:481
kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:491
insert_work+0x56/0x320 kernel/workqueue.c:1358
__queue_work+0x9e1/0xda0 kernel/workqueue.c:1517
queue_work_on+0xf2/0x170 kernel/workqueue.c:1545
usbnet_link_change+0xe6/0x100
usbnet_probe+0x1be3/0x2580 drivers/net/usb/usbnet.c:1834
usb_probe_interface+0x632/0xae0 drivers/usb/core/driver.c:396
really_probe+0x2af/0x910 drivers/base/dd.c:639
__driver_probe_device+0x1b4/0x280 drivers/base/dd.c:778
driver_probe_device+0x54/0x3d0 drivers/base/dd.c:808
__device_attach_driver+0x2dd/0x490 drivers/base/dd.c:936
bus_for_each_drv+0x18a/0x210 drivers/base/bus.c:427
__device_attach+0x322/0x530 drivers/base/dd.c:1008
device_initial_probe+0x1a/0x20 drivers/base/dd.c:1057
bus_probe_device+0xb9/0x1e0 drivers/base/bus.c:487
device_add+0xb15/0xed0 drivers/base/core.c:3517
usb_set_configuration+0x1a91/0x2010 drivers/usb/core/message.c:2170
usb_generic_driver_probe+0x89/0x150 drivers/usb/core/generic.c:238
usb_probe_device+0x13a/0x240 drivers/usb/core/driver.c:293
really_probe+0x2af/0x910 drivers/base/dd.c:639
__driver_probe_device+0x1b4/0x280 drivers/base/dd.c:778
driver_probe_device+0x54/0x3d0 drivers/base/dd.c:808
__device_attach_driver+0x2dd/0x490 drivers/base/dd.c:936
bus_for_each_drv+0x18a/0x210 drivers/base/bus.c:427
__device_attach+0x322/0x530 drivers/base/dd.c:1008
device_initial_probe+0x1a/0x20 drivers/base/dd.c:1057
bus_probe_device+0xb9/0x1e0 drivers/base/bus.c:487
device_add+0xb15/0xed0 drivers/base/core.c:3517
usb_new_device+0xba4/0x1770 drivers/usb/core/hub.c:2573
hub_port_connect drivers/usb/core/hub.c:5353 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5497 [inline]
port_event drivers/usb/core/hub.c:5653 [inline]
hub_event+0x2c36/0x5020 drivers/usb/core/hub.c:5735
process_one_work+0x6cb/0xc00 kernel/workqueue.c:2289
worker_thread+0xb3c/0x1390 kernel/workqueue.c:2436
kthread+0x26b/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306

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

The buggy address belongs to the physical page:
page:ffffea000458b200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1162c8
head:ffffea000458b200 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 0000000000000000 dead000000000001 ffff888100042140
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), pid 527, tgid 527 (udevd), ts 90868573025, free_ts 90733075532
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1eb/0x1f0 mm/page_alloc.c:2532
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x375/0x3f0 mm/page_alloc.c:4291
__alloc_pages+0x3d1/0x7c0 mm/page_alloc.c:5558
allocate_slab+0xb3/0x530 mm/slub.c:1939
new_slab mm/slub.c:1992 [inline]
___slab_alloc+0x4da/0x940 mm/slub.c:3180
__slab_alloc+0x5d/0xa0 mm/slub.c:3279
slab_alloc_node mm/slub.c:3364 [inline]
__kmem_cache_alloc_node+0x1f1/0x290 mm/slub.c:3437
kmalloc_trace+0x2a/0xa0 mm/slab_common.c:1045
kmalloc include/linux/slab.h:553 [inline]
kzalloc include/linux/slab.h:689 [inline]
uevent_show+0x15b/0x320 drivers/base/core.c:2487
dev_attr_show+0x56/0xd0 drivers/base/core.c:2195
sysfs_kf_seq_show+0x279/0x3a0 fs/sysfs/file.c:59
kernfs_seq_show+0x10e/0x160 fs/kernfs/file.c:201
seq_read_iter+0x429/0xd20 fs/seq_file.c:230
kernfs_fop_read_iter+0x15e/0x480 fs/kernfs/file.c:275
call_read_iter include/linux/fs.h:2193 [inline]
new_sync_read fs/read_write.c:389 [inline]
vfs_read+0x740/0xb00 fs/read_write.c:470
ksys_read+0x198/0x2c0 fs/read_write.c:613
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+0x4d0/0x4e0 mm/page_alloc.c:1532
free_unref_page_prepare mm/page_alloc.c:3387 [inline]
free_unref_page+0x70/0x530 mm/page_alloc.c:3483
free_the_page mm/page_alloc.c:770 [inline]
__free_pages+0xd8/0x100 mm/page_alloc.c:5644
__free_slab+0xd2/0x1b0 mm/slub.c:2016
free_slab mm/slub.c:2031 [inline]
discard_slab mm/slub.c:2037 [inline]
__unfreeze_partials+0x17d/0x1b0 mm/slub.c:2586
put_cpu_partial+0xa9/0x100 mm/slub.c:2662
__slab_free+0x203/0x280 mm/slub.c:3538
do_slab_free mm/slub.c:3615 [inline]
___cache_free+0xc6/0xd0 mm/slub.c:3668
qlink_free+0x4d/0x90 mm/kasan/quarantine.c:168
qlist_free_all+0x5a/0xd0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x15a/0x180 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x24/0x80 mm/kasan/common.c:302
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slab.h:737 [inline]
slab_alloc_node mm/slub.c:3398 [inline]
slab_alloc mm/slub.c:3406 [inline]
__kmem_cache_alloc_lru mm/slub.c:3413 [inline]
kmem_cache_alloc+0x18f/0x300 mm/slub.c:3422
mt_alloc_one lib/maple_tree.c:152 [inline]
mas_alloc_nodes+0x203/0x650 lib/maple_tree.c:1226
mas_node_count_gfp lib/maple_tree.c:1310 [inline]
mas_preallocate+0x12e/0x340 lib/maple_tree.c:5717
__vma_adjust+0x5c1/0x18e0 mm/mmap.c:716

Memory state around the buggy address:
ffff8881162caa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881162caa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881162cab00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881162cab80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881162cac00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
usb 2-1: new high-speed USB device number 28 using dummy_hcd
usb 2-1: New USB device found, idVendor=0525, idProduct=a4a1, bcdDevice= 0.40
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1: Product: syz
usb 2-1: Manufacturer: syz
usb 2-1: SerialNumber: syz
cdc_ncm 2-1:1.0: MAC-Address: 42:42:42:42:42:42
cdc_ncm 2-1:1.0: dwNtbInMaxSize=0 is too small. Using 2048
cdc_ncm 2-1:1.0: setting rx_max = 2048
cdc_ncm 2-1:1.0: setting tx_max = 184
cdc_ncm 2-1:1.0 usb1: register 'cdc_ncm' at usb-dummy_hcd.1-1, CDC NCM (NO ZLP), 42:42:42:42:42:42
usb 2-1: USB disconnect, device number 28
cdc_ncm 2-1:1.0 usb1: unregister 'cdc_ncm' usb-dummy_hcd.1-1, CDC NCM (NO ZLP)


Tested on:

commit: bce93322 proc: proc_skip_spaces() shouldn't think it i..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=133ef623880000
kernel config: https://syzkaller.appspot.com/x/.config?x=2070f89e3033302a
dashboard link: https://syzkaller.appspot.com/bug?extid=3512b5042ccf76dc6152
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2

Note: no patches were applied.
Reply all
Reply to author
Forward
0 new messages