tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Request for implementation of KERN_PROC_SIGTRAMP sysctl




> On Oct 28, 2021, at 8:49 AM, Valery Ushakov <uwe%stderr.spb.ru@localhost> wrote:
> 
> On Wed, Oct 27, 2021 at 20:59:12 -0700, Jason Thorpe wrote:
> 
>>> On Oct 27, 2021, at 4:01 PM, Jason Thorpe <thorpej%me.com@localhost> wrote:
>>> 
>>> 
>>>> On Oct 27, 2021, at 3:44 PM, Valery Ushakov <uwe%stderr.spb.ru@localhost> wrote:
>>>> 
>>>> On Wed, Oct 27, 2021 at 07:50:55 -0700, Jason Thorpe wrote:
>>>> 
>>>> I was wondering if it might be easier to not put the onus onto the
>>>> caller and instead have a function that returns the interrupted
>>>> ucontext (or NULL, if the pc is not in a trampoline).
>>>> 
>>>> ucontext_t *__unwind_sigtramp(return_pc, return_sp)
>>> 
>>> That would certainly be a nicer API.
>> 
>> Thought about it a little more.
>> 
>> To make this really work, we'd definitely have to version
>> sigaction() so that it fully de-supported sigcontext handlers.
>> Otherwise, it's a toss-up whether you have a sigcontext or a
>> ucontext on the stack.
> 
> It is ucontext for the siginfo trampoline and sigcontext for the older
> one, isn't it?

Sure, unless you're a platform that has never supported sigcontext, if you have COMPAT_16 disabled, or, ...

We really just need to kill the sigcontext stuff completely.  More to the point, we should version sigaction() before (or concurrently with) adding whatever call we add here so as to ensure that it will only ever be a ucontext.

-- thorpej



Home | Main Index | Thread Index | Old Index