⬢ DragonFlyBSD Kernel Audit
DF-2761 / fix.diff
← back to finding ↓ download raw
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1287,7 +1287,8 @@
 	if (error == ENAMETOOLONG)
 		error = EINVAL;
 	if (error == 0) {
-		lwkt_gettoken_shared(&p->p_token);
+		/* exclusive: s_login mutation must not interleave */
+		lwkt_gettoken(&p->p_token);
 		memcpy(p->p_pgrp->pg_session->s_login, buf, sizeof(buf));
 		lwkt_reltoken(&p->p_token);
 	}