[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220814172445.GR2125313@paulmck-ThinkPad-P17-Gen-1>
Date: Sun, 14 Aug 2022 10:24:45 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>, x86-ml <x86@...nel.org>,
Madhuparna Bhowmik <madhuparnabhowmik10@...il.com>,
Christian Brauner <brauner@...nel.org>
Subject: Re: [GIT PULL] timer fixes
On Sun, Aug 14, 2022 at 02:41:54PM +0200, Borislav Petkov wrote:
> On Sat, Aug 13, 2022 at 01:27:40PM -0700, Linus Torvalds wrote:
> > On Sat, Aug 13, 2022 at 9:25 AM Borislav Petkov <bp@...en8.de> wrote:
> > >
> > > That task_struct.sighand is marked __rcu and thus noderef and sparse
> > > complains:
> >
> > I think that RCU marking is misleading.
> >
> > Doing a
> >
> > git grep -e '->sighand'
> >
> > shows that we basically never treat that as some kind of RCU pointer.
> >
> > Adding a
> >
> > grep -i rcu
> >
> > to the above shows that we have a couple of places that do this
> > carefully, but they are the exception rather than the rule.
> >
> > I think the issue is that "current->sighand" is always safe (and that
> > "me->sighand" is the same thing), and that sighand has RCU-delayed
> > freeing so that __lock_task_sighand() can safely try to take the lock
> > of another process' sighand.
> >
> > And we have no real way to explain to sparse that *some* cases are
> > fine, others are not and need the sighand lock (after that careful
> > __lock_task_sighand thing).
>
> Sounds to me like that sparse check was not such a good idea in the
> first place. Especially since the 0day bot is probably warning about all
> those cases where we try to lock ->sighand.
>
> It was added by
>
> 913292c97d75 ("sched.h: Annotate sighand_struct with __rcu")
>
> Lemme add the involved parties to Cc.
If it is causing more trouble than it is worth, then I have not objection
to taking a different approach.
Thanx, Paul
Powered by blists - more mailing lists