Re: [PATCH] signal: Use list_del_init_careful() in flush_sigqueue()

From: Thomas Gleixner

Date: Mon Aug 24 2026 - 04:07:18 EST


On Sat, Aug 22 2026 at 14:37, Hyunwoo Kim wrote:
> diff --git a/kernel/signal.c b/kernel/signal.c
> index bbc0fd4cc4d7c1..ec9a0a0490d19f 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -482,7 +482,11 @@ void flush_sigqueue(struct sigpending *queue)
> sigemptyset(&queue->signal);
> while (!list_empty(&queue->list)) {
> q = list_entry(queue->list.next, struct sigqueue , list);
> - list_del_init(&q->list);
> + /*
> + * Pairs with the list_empty() in posixtimer_send_sigqueue().

No. That list_empty() would need to be changed to list_empty_careful()
to be correct on weakly ordered architectures.

Aside of that I'm not convinced that this is the right way to handle
this as it cures the symptom and not the underlying problem. Let me
stare at this some more.

Thanks,

tglx