From fdbaa60278d99ae90b16185ad58f959230b3a0fe Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 25 Apr 2003 19:52:30 +0000 Subject: [PATCH] Lock Giant around calls to useracc() in osf1_sigreturn() so that the function is MP safe. --- sys/alpha/osf1/osf1_signal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/alpha/osf1/osf1_signal.c b/sys/alpha/osf1/osf1_signal.c index d2ecd39d1e92..3f03ef173718 100644 --- a/sys/alpha/osf1/osf1_signal.c +++ b/sys/alpha/osf1/osf1_signal.c @@ -572,6 +572,7 @@ osf1_sigreturn(struct thread *td, p = td->td_proc; scp = uap->sigcntxp; + mtx_lock(&Giant); if (useracc((caddr_t)scp, sizeof (*scp), VM_PROT_READ) == 0 ) { uprintf("uac fails\n"); uprintf("scp: %p\n", scp); @@ -581,8 +582,11 @@ osf1_sigreturn(struct thread *td, * We grab it all at once for speed. */ if (useracc((caddr_t)scp, sizeof (*scp), VM_PROT_READ) == 0 || - copyin((caddr_t)scp, (caddr_t)&ksc, sizeof ksc)) + copyin((caddr_t)scp, (caddr_t)&ksc, sizeof ksc)) { + mtx_unlock(&Giant); return (EFAULT); + } + mtx_unlock(&Giant); /* * Restore the user-supplied information.