Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177881091
D53636.1795503801.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D53636.1795503801.diff
View Options
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
@@ -422,7 +422,7 @@
* pid must be in same session (EPERM)
* pid can't have done an exec (EACCES)
* if pgid != pid
- * there must exist some pid in same session having pgid (EPERM)
+ * there must exist some pid in same session having pgid (EPERM)
* pid must not be session leader (EPERM)
*/
#ifndef _SYS_SYSPROTO_H_
@@ -2792,10 +2792,6 @@
MPASS(oldcred != NULL);
PROC_LOCK_ASSERT(p, MA_OWNED);
- KASSERT(newcred->cr_users == 0, ("%s: users %d not 0 on cred %p",
- __func__, newcred->cr_users, newcred));
- KASSERT(newcred->cr_ref == 1, ("%s: ref %ld not 1 on cred %p",
- __func__, newcred->cr_ref, newcred));
if (newcred->cr_ruidinfo != oldcred->cr_ruidinfo) {
/*
@@ -2821,8 +2817,10 @@
__func__, oldcred->cr_users, oldcred));
oldcred->cr_users--;
mtx_unlock(&oldcred->cr_mtx);
+ mtx_lock(&newcred->cr_mtx);
+ ++newcred->cr_users;
+ mtx_unlock(&newcred->cr_mtx);
p->p_ucred = newcred;
- newcred->cr_users = 1;
PROC_UPDATE_COW(p);
if (newcred->cr_ruidinfo != oldcred->cr_ruidinfo)
(void)chgproccnt(oldcred->cr_ruidinfo, -1, 0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 24, 7:03 AM (2 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41949615
Default Alt Text
D53636.1795503801.diff (1 KB)
Attached To
Mode
D53636: proc_set_cred(): Allow 'newcred' to have multiple references
Attached
Detach File
Event Timeline