syzbot


KASAN: use-after-free Read in mem_cgroup_throttle_swaprate

Status: auto-closed as invalid on 2020/08/15 19:49
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+25aae20a3d0192870dd5@syzkaller.appspotmail.com
First crash: 1468d, last: 1468d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: use-after-free Read in mem_cgroup_throttle_swaprate 0 (1) 2020/04/21 08:36
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in mem_cgroup_throttle_swaprate 1 1478d 1478d 0/1 auto-closed as invalid on 2020/08/05 17:21

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:199 [inline]
BUG: KASAN: use-after-free in arch_atomic_read arch/x86/include/asm/atomic.h:31 [inline]
BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:27 [inline]
BUG: KASAN: use-after-free in blk_cgroup_congested include/linux/blk-cgroup.h:288 [inline]
BUG: KASAN: use-after-free in mem_cgroup_throttle_swaprate+0x2a9/0x4a0 mm/swapfile.c:3755
Read of size 4 at addr ffff888097c78cd8 by task syz-executor.3/19679

CPU: 1 PID: 19679 Comm: syz-executor.3 Not tainted 5.7.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1e9/0x30e lib/dump_stack.c:118
 print_address_description+0x74/0x5c0 mm/kasan/report.c:382
 __kasan_report+0x103/0x1a0 mm/kasan/report.c:511
 kasan_report+0x4d/0x80 mm/kasan/common.c:625

Allocated by task 1:
 save_stack mm/kasan/common.c:49 [inline]
 set_track mm/kasan/common.c:57 [inline]
 __kasan_kmalloc+0x114/0x160 mm/kasan/common.c:495
 kmem_cache_alloc_trace+0x234/0x300 mm/slab.c:3551
 kmalloc include/linux/slab.h:555 [inline]
 kzalloc include/linux/slab.h:669 [inline]
 cgroup1_root_to_use kernel/cgroup/cgroup-v1.c:1183 [inline]
 cgroup1_get_tree+0x747/0xae0 kernel/cgroup/cgroup-v1.c:1207
 vfs_get_tree+0x88/0x270 fs/super.c:1547
 do_new_mount fs/namespace.c:2816 [inline]
 do_mount+0x17ec/0x2900 fs/namespace.c:3141
 __do_sys_mount fs/namespace.c:3350 [inline]
 __se_sys_mount+0xd3/0x100 fs/namespace.c:3327
 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295
 entry_SYSCALL_64_after_hwframe+0x49/0xb3

Freed by task 8747:
 save_stack mm/kasan/common.c:49 [inline]
 set_track mm/kasan/common.c:57 [inline]
 kasan_set_free_info mm/kasan/common.c:317 [inline]
 __kasan_slab_free+0x125/0x190 mm/kasan/common.c:456
 __cache_free mm/slab.c:3426 [inline]
 kfree+0x10a/0x220 mm/slab.c:3757
 process_one_work+0x76e/0xfd0 kernel/workqueue.c:2268
 worker_thread+0xa7f/0x1450 kernel/workqueue.c:2414
 kthread+0x353/0x380 kernel/kthread.c:268
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

The buggy address belongs to the object at ffff888097c78000
 which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 3288 bytes inside of
 8192-byte region [ffff888097c78000, ffff888097c7a000)
The buggy address belongs to the page:
page:ffffea00025f1e00 refcount:1 mapcount:0 mapping:000000006ff58934 index:0x0 head:ffffea00025f1e00 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfffe0000010200(slab|head)
raw: 00fffe0000010200 ffffea00025f1408 ffffea00025f2708 ffff8880aa4021c0
raw: 0000000000000000 ffff888097c78000 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888097c78b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888097c78c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888097c78c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                    ^
 ffff888097c78d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888097c78d80: 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
2020/04/17 19:49 upstream 95988fbc7c31 435c6d53 .config console log report ci-upstream-kasan-gce-smack-root
2020/04/17 06:05 upstream 7a56db0299f9 18397578 .config console log report ci-upstream-kasan-gce-selinux-root
* Struck through repros no longer work on HEAD.