syzbot


KASAN: slab-use-after-free Read in process_one_work

Status: auto-obsoleted due to no activity on 2023/12/08 17:35
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+2e8adc6571c14586dd43@syzkaller.appspotmail.com
First crash: 405d, last: 398d
Similar bugs (8)
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 427 1d16h 711d 0/2 upstream: reported C repro on 2022/10/31 08:36
upstream KMSAN: kernel-infoleak in copyout (2) net C 6723 492d 1660d 22/28 fixed on 2023/06/08 14:41
android-5-10 BUG: corrupted list in process_one_work C error done 25 3d18h 916d 2/2 upstream: reported C repro on 2022/04/10 06:05
upstream KASAN: global-out-of-bounds Read in process_one_work kernel 1 149d 145d 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 1180d 1176d 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 715d 711d 0/28 auto-obsoleted due to no activity on 2023/01/25 20:05
android-6-1 KASAN: use-after-free Read in process_one_work origin:upstream missing-backport C error 566 5h42m 509d 0/2 upstream: reported C repro on 2023/05/21 23:04
android-54 KASAN: use-after-free Read in process_one_work 1 571d 571d 0/2 auto-obsoleted due to no activity on 2023/07/18 18:33

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline]
BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x2bf/0x3a0 kernel/locking/spinlock_debug.c:114
Read of size 4 at addr ffff88807e244504 by task kworker/0:1H/1014

CPU: 0 PID: 1014 Comm: kworker/0:1H Not tainted 6.5.0-syzkaller-12821-g6099776f9f26 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Workqueue: glock_workqueue glock_work_func
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0x163/0x540 mm/kasan/report.c:475
 kasan_report+0x175/0x1b0 mm/kasan/report.c:588
 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline]
 do_raw_spin_lock+0x2bf/0x3a0 kernel/locking/spinlock_debug.c:114
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0xe1/0x120 kernel/locking/spinlock.c:162
 __wake_up_common_lock kernel/sched/wait.c:137 [inline]
 __wake_up+0x101/0x1d0 kernel/sched/wait.c:160
 process_one_work+0x781/0x1130 kernel/workqueue.c:2630
 process_scheduled_works kernel/workqueue.c:2703 [inline]
 worker_thread+0xabf/0x1060 kernel/workqueue.c:2784
 kthread+0x2b8/0x350 kernel/kthread.c:388
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
 </TASK>

Allocated by task 6064:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4f/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383
 kmalloc include/linux/slab.h:599 [inline]
 kzalloc include/linux/slab.h:720 [inline]
 init_sbd fs/gfs2/ops_fstype.c:77 [inline]
 gfs2_fill_super+0x136/0x26c0 fs/gfs2/ops_fstype.c:1164
 get_tree_bdev+0x416/0x5b0 fs/super.c:1577
 gfs2_get_tree+0x54/0x210 fs/gfs2/ops_fstype.c:1348
 vfs_get_tree+0x8c/0x280 fs/super.c:1750
 do_new_mount+0x28f/0xae0 fs/namespace.c:3335
 do_mount fs/namespace.c:3675 [inline]
 __do_sys_mount fs/namespace.c:3884 [inline]
 __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 6064:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4f/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:164 [inline]
 slab_free_hook mm/slub.c:1800 [inline]
 slab_free_freelist_hook mm/slub.c:1826 [inline]
 slab_free mm/slub.c:3809 [inline]
 __kmem_cache_free+0x25f/0x3b0 mm/slub.c:3822
 free_sbd fs/gfs2/ops_fstype.c:69 [inline]
 gfs2_fill_super+0x12e2/0x26c0 fs/gfs2/ops_fstype.c:1331
 get_tree_bdev+0x416/0x5b0 fs/super.c:1577
 gfs2_get_tree+0x54/0x210 fs/gfs2/ops_fstype.c:1348
 vfs_get_tree+0x8c/0x280 fs/super.c:1750
 do_new_mount+0x28f/0xae0 fs/namespace.c:3335
 do_mount fs/namespace.c:3675 [inline]
 __do_sys_mount fs/namespace.c:3884 [inline]
 __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff88807e244000
 which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 1284 bytes inside of
 freed 8192-byte region [ffff88807e244000, ffff88807e246000)

The buggy address belongs to the physical page:
page:ffffea0001f89000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e240
head:ffffea0001f89000 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888012842280 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000020002 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 5865, tgid 5862 (syz-executor.2), ts 216235312388, free_ts 216224917025
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1536
 prep_new_page mm/page_alloc.c:1543 [inline]
 get_page_from_freelist+0x31db/0x3360 mm/page_alloc.c:3170
 __alloc_pages+0x255/0x670 mm/page_alloc.c:4426
 alloc_slab_page+0x6a/0x160 mm/slub.c:1870
 allocate_slab mm/slub.c:2017 [inline]
 new_slab+0x84/0x2f0 mm/slub.c:2070
 ___slab_alloc+0xade/0x1100 mm/slub.c:3223
 __slab_alloc mm/slub.c:3322 [inline]
 __slab_alloc_node mm/slub.c:3375 [inline]
 slab_alloc_node mm/slub.c:3468 [inline]
 __kmem_cache_alloc_node+0x1af/0x270 mm/slub.c:3517
 __do_kmalloc_node mm/slab_common.c:1022 [inline]
 __kmalloc+0xa8/0x230 mm/slab_common.c:1036
 kmalloc_array include/linux/slab.h:636 [inline]
 mb_cache_create+0x156/0x560 fs/mbcache.c:370
 __ext4_fill_super fs/ext4/super.c:5416 [inline]
 ext4_fill_super+0x4f81/0x6d10 fs/ext4/super.c:5703
 get_tree_bdev+0x416/0x5b0 fs/super.c:1577
 vfs_get_tree+0x8c/0x280 fs/super.c:1750
 do_new_mount+0x28f/0xae0 fs/namespace.c:3335
 do_mount fs/namespace.c:3675 [inline]
 __do_sys_mount fs/namespace.c:3884 [inline]
 __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1136 [inline]
 free_unref_page_prepare+0x8c3/0x9f0 mm/page_alloc.c:2312
 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2405
 napi_frag_unref include/linux/skbuff.h:3450 [inline]
 skb_release_data+0x446/0x850 net/core/skbuff.c:981
 skb_release_all net/core/skbuff.c:1053 [inline]
 __kfree_skb net/core/skbuff.c:1067 [inline]
 napi_consume_skb+0x123/0x200 net/core/skbuff.c:1357
 free_old_xmit_skbs+0x12a/0x440 drivers/net/virtio_net.c:761
 virtnet_poll_tx+0x214/0x550 drivers/net/virtio_net.c:2249
 __napi_poll+0xc7/0x470 net/core/dev.c:6527
 napi_poll net/core/dev.c:6594 [inline]
 net_rx_action+0x78b/0x1010 net/core/dev.c:6727
 __do_softirq+0x2ab/0x908 kernel/softirq.c:553

Memory state around the buggy address:
 ffff88807e244400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88807e244480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807e244500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff88807e244580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88807e244600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/09 17:34 upstream 6099776f9f26 6654cf89 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in process_one_work
2023/09/03 00:31 upstream 0468be89b3fa 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in process_one_work
* Struck through repros no longer work on HEAD.