Re: [PATCH] signalfd: don't dequeue the forced fatal signals
From: Oleg Nesterov
Date: Tue Apr 07 2026 - 17:26:46 EST
On 04/08, kernel test robot wrote:
>
> kernel test robot noticed the following build warnings:
...
> sparse warnings: (new ones prefixed by >>)
> >> fs/signalfd.c:53:40: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct k_sigaction *k @@ got struct k_sigaction [noderef] __rcu * @@
...
> vim +53 fs/signalfd.c
>
> 50
> 51 static void mk_sigmask(struct signalfd_ctx *ctx, sigset_t *sigmask)
> 52 {
> > 53 struct k_sigaction *k = current->sighand->action;
I am going to ignore this new warning...
Yes, task_struct->sighand is __rcu. Not sure this annotation makes a lot of sense.
In any case. current->sighand is always stable. Plus task->sighand is stable under siglock.
We have a lot of (correct) non-rcu deferences of ->sighand.
I think that only lock_task_sighand() needs rcu_dereference(tsk->sighand).
Say, __exit_signal() does
sighand = rcu_dereference_check(tsk->sighand,
lockdep_tasklist_lock_is_held());
To me this just adds the unnecessary noise. I do not want to add another precedent.
Oleg.