[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wi+K-LQ121sPbsQonja3Sx-_kXZc6ntauUC2=JPsUrC+g@mail.gmail.com>
Date: Sat, 13 Aug 2022 13:27:40 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Borislav Petkov <bp@...en8.de>
Cc: 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>
Subject: Re: [GIT PULL] timer fixes
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).
Linus
Powered by blists - more mailing lists