[Android 5.4] KASAN: use-after-free Read in process_one_work

11 views
Skip to first unread message

syzbot

unread,
Mar 20, 2023, 2:33:02 PM3/20/23
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 2e56f91f9731 BACKPORT: blk-mq: fix is_flush_rq
git tree: android12-5.4
console output: https://syzkaller.appspot.com/x/log.txt?x=128f836ec80000
kernel config: https://syzkaller.appspot.com/x/.config?x=e270749e5a0ba365
dashboard link: https://syzkaller.appspot.com/bug?extid=284b84369cf9d8c44148
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/02d6c386fcb7/disk-2e56f91f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c57bbecb5519/vmlinux-2e56f91f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/2c1d3310985f/bzImage-2e56f91f.xz

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

==================================================================
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
==================================================================


---
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

unread,
Jul 18, 2023, 2:33:36 PM7/18/23
to syzkaller-a...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages