Local privilege escalation via execve(2) TOCTOU race
FreeBSD
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| FreeBSD FreeBSD |
| No fix yet |
Original description
During execve(2) of a SUID binary, the new virtual address space is installed before the process credentials are updated. During this window, a process running as the same user can access the target process's memory via procfs or linprocfs, because the kernel's debugging permission check still saw the original credentials.
An unprivileged local user can exploit this race to modify the address space of a SUID binary before its credentials are elevated, potentially gaining full control of the affected system.