summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_prot.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-03-22 21:02:02 +0000
committerjhb <jhb@FreeBSD.org>2002-03-22 21:02:02 +0000
commit59d20d5aab1a3950631580f447d2067770597d01 (patch)
tree4389542d09e3b09bea71f1eb40149f2bc6acf83b /sys/kern/kern_prot.c
parentd1fbde7cf6ef772e6c5064bd6ecb2d6d2b95adb0 (diff)
downloadFreeBSD-src-59d20d5aab1a3950631580f447d2067770597d01.zip
FreeBSD-src-59d20d5aab1a3950631580f447d2067770597d01.tar.gz
Use explicit Giant locks and unlocks for rather than instrumented ones for
code that is still not safe. suser() reads p_ucred so it still needs Giant for the time being. This should allow kern.giant.proc to be set to 0 for the time being.
Diffstat (limited to 'sys/kern/kern_prot.c')
-rw-r--r--sys/kern/kern_prot.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index f02aab4..c722e10 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -165,9 +165,9 @@ getpgid(td, uap)
{
struct proc *p = td->td_proc;
struct proc *pt;
- int error, s;
+ int error;
- s = mtx_lock_giant(kern_giant_proc);
+ mtx_lock(&Giant);
error = 0;
if (uap->pid == 0) {
PROC_LOCK(p);
@@ -181,7 +181,7 @@ getpgid(td, uap)
td->td_retval[0] = pt->p_pgrp->pg_id;
PROC_UNLOCK(pt);
}
- mtx_unlock_giant(s);
+ mtx_unlock(&Giant);
return (error);
}
@@ -204,9 +204,8 @@ getsid(td, uap)
struct proc *p = td->td_proc;
struct proc *pt;
int error;
- int s;
- s = mtx_lock_giant(kern_giant_proc);
+ mtx_lock(&Giant);
error = 0;
if (uap->pid == 0) {
PROC_LOCK(p);
@@ -220,7 +219,7 @@ getsid(td, uap)
td->td_retval[0] = pt->p_session->s_sid;
PROC_UNLOCK(pt);
}
- mtx_unlock_giant(s);
+ mtx_unlock(&Giant);
return (error);
}
OpenPOWER on IntegriCloud