summaryrefslogtreecommitdiffstats
path: root/sys/alpha
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-04-25 19:52:30 +0000
committerjhb <jhb@FreeBSD.org>2003-04-25 19:52:30 +0000
commit8db9172888dfef999398ecc89d0eaa7bfa1d8ee1 (patch)
tree7c583ce3574489c2254a1a7bc1f059cbbe1c5aa0 /sys/alpha
parent61d12d651940a5b8227a7eb7c8cb8dc39a98ebb8 (diff)
downloadFreeBSD-src-8db9172888dfef999398ecc89d0eaa7bfa1d8ee1.zip
FreeBSD-src-8db9172888dfef999398ecc89d0eaa7bfa1d8ee1.tar.gz
Lock Giant around calls to useracc() in osf1_sigreturn() so that the
function is MP safe.
Diffstat (limited to 'sys/alpha')
-rw-r--r--sys/alpha/osf1/osf1_signal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/alpha/osf1/osf1_signal.c b/sys/alpha/osf1/osf1_signal.c
index d2ecd39..3f03ef1 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.
OpenPOWER on IntegriCloud