{
struct hurd_sigstate *ss;
struct hurd_userlink *link = (void *) &scp[1];
+ int *usp;
+
+ /* Stack usage while trampolining back:
+ * register dump, parameters, and rough estimation of usage in __sigreturn2
+ * before unlocking ss. */
+ size_t tramp_usage = 18 * sizeof (uintptr_t) + 32;
if (__glibc_unlikely (scp == NULL || (scp->sc_mask & _SIG_CANT_MASK)))
return __hurd_fail (EINVAL);
+ usp = (int *) scp->sc_uesp;
+
+ /* If we are to segfault, do it now before locking the ss. */
+ memset ((void*) usp - tramp_usage, 0, tramp_usage);
+
ss = _hurd_self_sigstate ();
_hurd_sigstate_lock (ss);
copy the registers onto the user's stack, switch there, pop and
return. */
- int usp_arg, *usp = (int *) scp->sc_uesp;
+ int usp_arg;
*--usp = scp->sc_eip;
*--usp = scp->sc_efl;
uintptr_t *usp;
mach_port_t sc_reply_port;
+ /* Stack usage while trampolining back:
+ * register dump, 16B round-up, and rough estimation of usage in __sigreturn2
+ * before unlocking ss. */
+ size_t tramp_usage = 17 * sizeof (uintptr_t) + 16 + 64;
+
if (__glibc_unlikely (scp == NULL || (scp->sc_mask & _SIG_CANT_MASK)))
return __hurd_fail (EINVAL);
+ /* Respect the redzone. */
+ usp = (uintptr_t *) (scp->sc_ursp - 128);
+
+ /* If we are to segfault, do it now before locking the ss. */
+ memset ((void*) usp - tramp_usage, 0, tramp_usage);
+
ss = _hurd_self_sigstate ();
_hurd_sigstate_lock (ss);
located at a larger address than the sigcontext. */
sc_reply_port = scp->sc_reply_port;
- usp = (uintptr_t *) (scp->sc_ursp - 128);
*--usp = scp->sc_rip;
*--usp = scp->sc_rfl;