[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aN_dPpjupRpc9Tj1@slm.duckdns.org>
Date: Fri, 3 Oct 2025 04:27:10 -1000
From: Tejun Heo <tj@...nel.org>
To: Michal Koutný <mkoutny@...e.com>
Cc: Nirbhay Sharma <nirbhay.lkd@...il.com>,
Johannes Weiner <hannes@...xchg.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Clark Williams <clrkwllms@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Tiffany Yang <ynaffit@...gle.com>, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-rt-devel@...ts.linux.dev,
syzbot+27a2519eb4dad86d0156@...kaller.appspotmail.com,
skhan@...uxfoundation.org, david.hunter.linux@...il.com,
linux-kernel-mentees@...ts.linuxfoundation.org,
Kuniyuki Iwashima <kuniyu@...gle.com>
Subject: Re: [PATCH] cgroup: Fix seqcount lockdep assertion in cgroup freezer
On Fri, Oct 03, 2025 at 04:00:22PM +0200, Michal Koutný wrote:
> On Fri, Oct 03, 2025 at 05:15:55PM +0530, Nirbhay Sharma <nirbhay.lkd@...il.com> wrote:
> > The commit afa3701c0e45 ("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: syzbot+27a2519eb4dad86d0156@...kaller.appspotmail.com
> > Closes: https://syzkaller.appspot.com/bug?extid=27a2519eb4dad86d0156
> > Fixes: afa3701c0e45 ("cgroup: cgroup.stat.local time accounting")
> > Signed-off-by: Nirbhay Sharma <nirbhay.lkd@...il.com>
>
> Link: https://lore.kernel.org/r/20251002165510.KtY3IT--@linutronix.de/
>
> Yes, this is what was discussed yesterday. Thanks.
>
> Acked-by: Michal Koutný <mkoutny@...e.com>
Okay, reverting that one and applying this one.
Thanks.
--
tejun
Powered by blists - more mailing lists