RE: [PATCH RFC][try 2] IA64 signal : remove redundant code in setup_sigcontext()

From: Luck, Tony <tony.luck_at_intel.com>
Date: 2007-12-19 10:29:19
>> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Dec 19 10:29:35 2007

This archive was generated by hypermail 2.1.8 : 2007-12-19 10:29:59 EST