diff options
author | julian <julian@FreeBSD.org> | 2002-02-19 03:16:50 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2002-02-19 03:16:50 +0000 |
commit | 24b4ea7e20a0b1625b3b3289ddb2d21aec75c755 (patch) | |
tree | 7a1b1e77191af54f75002e956befc6af56d68046 | |
parent | e561ca6dce9bfce4a370c4046c20f4332d55fe5c (diff) | |
download | FreeBSD-src-24b4ea7e20a0b1625b3b3289ddb2d21aec75c755.zip FreeBSD-src-24b4ea7e20a0b1625b3b3289ddb2d21aec75c755.tar.gz |
Duplicate the changes to i386 to keep creds over the user boundary.
-rw-r--r-- | sys/ia64/ia64/trap.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c index f652a11..a0ca070 100644 --- a/sys/ia64/ia64/trap.c +++ b/sys/ia64/ia64/trap.c @@ -324,9 +324,8 @@ trap(int vector, int imm, struct trapframe *framep) sticks = td->td_kse->ke_sticks; td->td_frame = framep; KASSERT(td->td_ucred == NULL, ("already have a ucred")); - PROC_LOCK(p); - td->td_ucred = crhold(p->p_ucred); - PROC_UNLOCK(p); + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); } else { sticks = 0; /* XXX bogus -Wuninitialized warning */ KASSERT(cold || td->td_ucred != NULL, @@ -709,10 +708,12 @@ out: if (user) { userret(td, framep, sticks); mtx_assert(&Giant, MA_NOTOWNED); +#ifdef INVARIANTS mtx_lock(&Giant); crfree(td->td_ucred); mtx_unlock(&Giant); td->td_ucred = NULL; +#endif } return; @@ -758,9 +759,8 @@ syscall(int code, u_int64_t *args, struct trapframe *framep) td->td_frame = framep; sticks = td->td_kse->ke_sticks; KASSERT(td->td_ucred == NULL, ("already have a ucred")); - PROC_LOCK(p); - td->td_ucred = crhold(p->p_ucred); - PROC_UNLOCK(p); + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); /* * Skip past the break instruction. Remember old address in case @@ -865,10 +865,12 @@ syscall(int code, u_int64_t *args, struct trapframe *framep) */ STOPEVENT(p, S_SCX, code); +#ifdef INVARIANTS mtx_lock(&Giant); crfree(td->td_ucred); mtx_unlock(&Giant); td->td_ucred = NULL; +#endif #ifdef WITNESS if (witness_list(td)) { panic("system call %s returning with mutex(s) held\n", |