Commit 93a4b36
cgroup: Fix seqcount lockdep assertion in cgroup freezer
The commit afa3701 ("cgroup: cgroup.stat.local time accounting")
introduced a seqcount to track freeze timing but initialized it as a
plain seqcount_t using seqcount_init().
However, the write-side critical section in cgroup_do_freeze() holds
the css_set_lock spinlock while calling write_seqcount_begin(). On
PREEMPT_RT kernels, spinlocks do not disable preemption, causing the
lockdep assertion for a plain seqcount_t, which checks for preemption
being disabled, to fail.
This triggers the following warning:
WARNING: CPU: 0 PID: 9692 at include/linux/seqlock.h:221
Fix this by changing the type to seqcount_spinlock_t and initializing
it with seqcount_spinlock_init() to associate css_set_lock with the
seqcount. This allows lockdep to correctly validate that the spinlock
is held during write operations, resolving the assertion failure on all
kernel configurations.
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=27a2519eb4dad86d0156
Fixes: afa3701 ("cgroup: cgroup.stat.local time accounting")
Signed-off-by: Nirbhay Sharma <[email protected]>
Link: https://lore.kernel.org/r/[email protected]/
Acked-by: Michal Koutný <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>1 parent e406d57 commit 93a4b36
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
455 | | - | |
| 455 | + | |
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5892 | 5892 | | |
5893 | 5893 | | |
5894 | 5894 | | |
5895 | | - | |
| 5895 | + | |
5896 | 5896 | | |
5897 | 5897 | | |
5898 | 5898 | | |
| |||
0 commit comments