Re: [PATCH] signal/x86: Delay calling signals in atomic

From: Sebastian Andrzej Siewior
Date: Fri Apr 01 2022 - 07:45:10 EST


On 2022-03-30 13:10:05 [-0500], Eric W. Biederman wrote:
> But it looks like if we are coming from userspace then we use the same
> stack as any other time we would come from userspace. AKA a stack
> that allows the kernel to sleep.
>
> So I don't see what the problem is that is trying to be fixed.

It is not only the stack. In atomic context / disabled interrupts it is
not possible to acquire a spinlock_t (sighand_struct::siglock) which is
done later.

> I know that code has been changed over the years, perhaps this is
> something that was fixed upstream and the real time tree didn't realize
> there was no longer a need to fix anything?
>
> Or am I missing something subtle when reading the idtentry assembly?

It certainly is true that the code changed over the years. The per-CPU
stack is one problem, the siglock in atomic context is the other one.
Thank you for the input. Let me digest the informations I have here and
get back.

> Eric

Sebastian