Re: [patch V2 1/8] signal: Prevent exec() race

From: Oleg Nesterov

Date: Sun Sep 06 2026 - 19:29:11 EST


On 09/06, Eric W. Biederman wrote:
>
> Thomas Gleixner <tglx@xxxxxxxxxx> writes:
>
> > @@ -1019,6 +1029,21 @@ static inline bool legacy_queue(struct s
> > return (sig < SIGRTMIN) && sigismember(&signals->signal, sig);
> > }
> >
> > +/*
> > + * When PF_EXITING is set the task is on the way out and has t::pending
> > + * flushed already. Prevent queueing of PIDTYPE_PID signals as they would
> > + * be leaked.
> > + */
> > +static inline bool task_can_queue_signal(struct task_struct *t, enum pid_type type)
> > +{
> > + lockdep_assert_held(&t->sighand->siglock);
> > +
> > + if (!(t->flags & PF_EXITING))
> > + return true;
> > +
>
> I don't know if we care but I just noticed that this disallows
> using tkill(..., SIGKILL) or tgkill(..., SIGKILL) to stop coredumps.

I think we do care, but the coredumping thread is not PF_EXITING ?

Oleg.