Page MenuHomeFreeBSD

D33986.diff
No OneTemporary

D33986.diff

diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1460,10 +1460,12 @@
int
p_cansee(struct thread *td, struct proc *p)
{
-
/* Wrap cr_cansee() for all functionality. */
KASSERT(td == curthread, ("%s: td not curthread", __func__));
PROC_LOCK_ASSERT(p, MA_OWNED);
+
+ if (td->td_proc == p)
+ return (0);
return (cr_cansee(td->td_ucred, p->p_ucred));
}
@@ -1681,10 +1683,10 @@
KASSERT(td == curthread, ("%s: td not curthread", __func__));
PROC_LOCK_ASSERT(p, MA_OWNED);
- if ((error = priv_check(td, PRIV_DEBUG_UNPRIV)))
- return (error);
if (td->td_proc == p)
return (0);
+ if ((error = priv_check(td, PRIV_DEBUG_UNPRIV)))
+ return (error);
if ((error = prison_check(td->td_ucred, p->p_ucred)))
return (error);
#ifdef MAC

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 17, 12:33 AM (17 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23769174
Default Alt Text
D33986.diff (819 B)

Event Timeline