lkml.org 
[lkml]   [2007]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [PATCH RFC][try 2] IA64 signal : remove redundant code in setup_sigcontext()
Date
From
>> This patch removes some redundant code in the function setup_sigcontext().
>>
>> The registers ar.ccv,b7,r14,ar.csd,ar.ssd,r2-r3 and r16-r31 are not restored
>> in restore_sigcontext() when (flags & IA64_SC_FLAG_IN_SYSCALL) is true.
>> So we don't need to zero those variables in setup_sigcontext().
>
> Erm, couldn't those registers contain information the process shouldn't
> see?

No, this looks safe. setup_sigcontext() is stashing things out on the
user stack to be used by restore_sigcontext() should the application want
to return from the signal handler. But restore_sigcontext isn't actually
in charge of putting values into machine registers, it just does the copy
back from user space to the place where the asm code will restore registers
on the way back to userland. In this instance "restored" means "set back to
the state they had before the signal happened". If they aren't "restored"
they'll have scratch values ... but those scratch values will have come
from the application (while it was executing the signal handler). Not
leaked from the kernel or from some other application.

-Tony


\
 
 \ /
  Last update: 2007-12-19 00:31    [W:0.030 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site