[PATCH 0/4] Help to debug spinlocks

John Wood john.wood at gmx.com
Sun Dec 20 06:47:08 EST 2020

On Sat, Dec 19, 2020 at 12:46:37PM +0100, John Wood wrote:
> Hi,
> I'm working in a new LSM to detect and mitigate any fork brute force
> attack against vulnerable userspace processes. I'm testing the detection
> method but I have found some problems that I think are related to locking
> since the kernel gets stuck but not crashes. This work is a WIP to obtain
> the v3 version. The mitigation, documentation and fine tunning detection
> are under construction.
> My problem is that I don't be able to find the cause of this behaviour and
> any help would be greatly appreciated.

I think that I have found the cause of the problem.

I acquired the brute_stats_ptr_lock in the task_fatal_signal hook without
disable interrupts. Then, the task_free hook was call from an IRQ context
and tried to acquire the same lock in a write state. This cause a deadlock.

Thanks anyway,
John Wood

More information about the Kernelnewbies mailing list