Re: Question about signal syscalls !

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

 



Franck Bui-Huu wrote:
David Daney wrote:
sys_sigreturn does not return to the caller in the conventional sense.

I expect you're talking about this bite of code taken from _sys_sigreturn():

       /*
        * Don't let your children do this ...
        */
       __asm__ __volatile__(
               "move\t$29, %0\n\t"
               "j\tsyscall_exit"
               :/* no outputs */
               :"r" (&regs));

The entire user context (i.e. the value of *all* registers) is replaced
with the values stored in the sigcontext structure on the caller's
stack.  If all registers are being restored from the sigcontext, then
there is no need to save the current values of the registers, because
they will never be used.


But I don't see where _all_ registers are saved. Only static registers
are saved by save_static_function() right before calling
_sys_sigreturn() and I agree I don't why we need to save those.

And now I'm starting to think that we don't need to save static regs in
setup_sigcontext() either...

All registers *must* be saved in the sigcontext. That is part of the contract the kernel has with user code.

On return from an asynchronous signal, *all* registers must contain the same values they had before the process was interrupted.

David Daney

David Daney



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux