Re: + taskstats-copy-signal-stats-under-siglock-in-taskstats_exit.patch added to mm-nonmm-unstable branch

Oleg Nesterov <[email protected]> Tue, 4 Aug 2026 22:39:23 +0200
Newsgroups org.kernel.vger.mm-commits
Message-ID <[email protected]>
On 08/04, Andrew Morton wrote:
>
> From: Bradley Morgan <[email protected]>
> Subject: taskstats: copy signal->stats under siglock in taskstats_exit

...

> --- a/kernel/taskstats.c~taskstats-copy-signal-stats-under-siglock-in-taskstats_exit
> +++ a/kernel/taskstats.c
> @@ -590,6 +590,7 @@ void taskstats_exit(struct task_struct *
>  	struct sk_buff *rep_skb;
>  	size_t size;
>  	int is_thread_group;
> +	unsigned long flags;
>  
>  	if (!family_registered)
>  		return;
> @@ -635,7 +636,10 @@ void taskstats_exit(struct task_struct *
>  	if (!stats)
>  		goto err;
>  
> +	/* This was racy before, copy the stats under siglock. */
> +	spin_lock_irqsave(&tsk->sighand->siglock, flags);

Why _irqsave? The only caller is do_exit(), and it obviously runs with
irqs enabled?

Oleg.