Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161671239
D53636.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
863 B
Referenced Files
None
Subscribers
None
D53636.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
@@ -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
Mon, Jul 6, 7:53 PM (15 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34766940
Default Alt Text
D53636.diff (863 B)
Attached To
Mode
D53636: proc_set_cred(): Allow 'newcred' to have multiple references
Attached
Detach File
Event Timeline
Log In to Comment