git: 34b95f53e7ac - stable/14 - sys_set*id(9): wait for the execblocks to pass
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 28 Jun 2026 00:30:17 UTC
The branch stable/14 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=34b95f53e7ac3a055b3d866d101a79e85d0022c4
commit 34b95f53e7ac3a055b3d866d101a79e85d0022c4
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-06-17 19:07:22 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-06-28 00:29:04 +0000
sys_set*id(9): wait for the execblocks to pass
(cherry picked from commit d0384f50dad25d3358d76f7556969ea1d515ba68)
---
sys/kern/kern_prot.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index d6f8faf23814..8b5e06820b2c 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -51,6 +51,7 @@
#include <sys/systm.h>
#include <sys/abi_compat.h>
#include <sys/acct.h>
+#include <sys/imgact.h>
#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/libkern.h>
@@ -1010,6 +1011,8 @@ sys_seteuid(struct thread *td, struct seteuid_args *uap)
newcred = crget();
euip = uifind(euid);
PROC_LOCK(p);
+ execve_block_pass(td);
+
/*
* Copy credentials so other references do not see our changes.
*/
@@ -1064,6 +1067,7 @@ sys_setgid(struct thread *td, struct setgid_args *uap)
AUDIT_ARG_GID(gid);
newcred = crget();
PROC_LOCK(p);
+ execve_block_pass(td);
oldcred = crcopysafe(p, newcred);
#ifdef MAC
@@ -1162,6 +1166,7 @@ sys_setegid(struct thread *td, struct setegid_args *uap)
AUDIT_ARG_EGID(egid);
newcred = crget();
PROC_LOCK(p);
+ execve_block_pass(td);
oldcred = crcopysafe(p, newcred);
#ifdef MAC
@@ -1257,6 +1262,7 @@ kern_setgroups(struct thread *td, int *ngrpp, gid_t *groups)
if (ngrp != 0)
crextend(newcred, ngrp);
PROC_LOCK(p);
+ execve_block_pass(td);
oldcred = crcopysafe(p, newcred);
#ifdef MAC
@@ -1319,6 +1325,7 @@ sys_setreuid(struct thread *td, struct setreuid_args *uap)
euip = uifind(euid);
ruip = uifind(ruid);
PROC_LOCK(p);
+ execve_block_pass(td);
oldcred = crcopysafe(p, newcred);
#ifdef MAC
@@ -1398,6 +1405,7 @@ sys_setregid(struct thread *td, struct setregid_args *uap)
AUDIT_ARG_RGID(rgid);
newcred = crget();
PROC_LOCK(p);
+ execve_block_pass(td);
oldcred = crcopysafe(p, newcred);
#ifdef MAC
@@ -1468,6 +1476,7 @@ sys_setresuid(struct thread *td, struct setresuid_args *uap)
euip = uifind(euid);
ruip = uifind(ruid);
PROC_LOCK(p);
+ execve_block_pass(td);
oldcred = crcopysafe(p, newcred);
#ifdef MAC
@@ -1559,6 +1568,7 @@ sys_setresgid(struct thread *td, struct setresgid_args *uap)
AUDIT_ARG_SGID(sgid);
newcred = crget();
PROC_LOCK(p);
+ execve_block_pass(td);
oldcred = crcopysafe(p, newcred);
#ifdef MAC