Re: [PATCH v2 2/2] getrusage: use sig->stats_lock rather than lock_task_sighand()

From: Andrew Morton
Date: Mon Jan 22 2024 - 19:23:16 EST


On Mon, 22 Jan 2024 16:50:53 +0100 Oleg Nesterov <oleg@xxxxxxxxxx> wrote:

> lock_task_sighand() can trigger a hard lockup. If NR_CPUS threads call
> getrusage() at the same time and the process has NR_THREADS, spin_lock_irq
> will spin with irqs disabled O(NR_CPUS * NR_THREADS) time.

It would be super interesting to see Dylan's original report.

Is it possible for carefully-crafted unprivileged userspace to
deliberately trigger this?