syzbot


BUG: sleeping function called from invalid context in cgroup_rstat_flush

Status: fixed on 2024/08/14 03:44
Subsystems: cgroups
[Documentation on labels]
Reported-by: syzbot+b7f13b2d0cc156edf61a@syzkaller.appspotmail.com
Fix commit: 5a4d8944d6b1 cachestat: do not flush stats in recency check
First crash: 80d, last: 63d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] cachestat: do not flush stats in recency check 3 (3) 2024/06/28 01:58
[syzbot] [cgroups?] BUG: sleeping function called from invalid context in cgroup_rstat_flush 2 (3) 2024/06/27 19:09

Sample crash report:
BUG: sleeping function called from invalid context at kernel/cgroup/rstat.c:351
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 6275, name: syz.0.245
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
1 lock held by syz.0.245/6275:
 #0: ffffffff8e333f20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
 #0: ffffffff8e333f20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
 #0: ffffffff8e333f20 (rcu_read_lock){....}-{1:2}, at: filemap_cachestat mm/filemap.c:4251 [inline]
 #0: ffffffff8e333f20 (rcu_read_lock){....}-{1:2}, at: __do_sys_cachestat mm/filemap.c:4407 [inline]
 #0: ffffffff8e333f20 (rcu_read_lock){....}-{1:2}, at: __se_sys_cachestat+0x3ee/0xbb0 mm/filemap.c:4372
CPU: 1 PID: 6275 Comm: syz.0.245 Not tainted 6.10.0-rc7-syzkaller-00012-g34afb82a3c67 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 __might_resched+0x5d4/0x780 kernel/sched/core.c:10196
 cgroup_rstat_flush+0x1e/0x50 kernel/cgroup/rstat.c:351
 workingset_test_recent+0x48a/0xa90 mm/workingset.c:473
 filemap_cachestat mm/filemap.c:4314 [inline]
 __do_sys_cachestat mm/filemap.c:4407 [inline]
 __se_sys_cachestat+0x795/0xbb0 mm/filemap.c:4372
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa8f1b75bd9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa8f299e048 EFLAGS: 00000246 ORIG_RAX: 00000000000001c3
RAX: ffffffffffffffda RBX: 00007fa8f1d041e8 RCX: 00007fa8f1b75bd9
RDX: 0000000020000080 RSI: 0000000020000040 RDI: 0000000000000006
RBP: 00007fa8f1be4e60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007fa8f1d041e8 R15: 00007fff72eab508
 </TASK>

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/10 01:17 upstream 34afb82a3c67 79d68ada .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in cgroup_rstat_flush
2024/07/07 16:56 upstream c6653f49e4fd bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in cgroup_rstat_flush
2024/07/07 16:55 upstream c6653f49e4fd bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in cgroup_rstat_flush
2024/07/03 18:52 upstream e9d22f7a6655 409d975c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in cgroup_rstat_flush
2024/06/24 07:12 upstream 7c16f0a4ed1c edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in cgroup_rstat_flush
2024/06/23 13:59 upstream 5f583a3162ff edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in cgroup_rstat_flush
* Struck through repros no longer work on HEAD.