diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2026-07-27 15:41:30 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2026-07-29 17:48:13 +0000 |
| commit | e2585687890e449850497b6f018b1fd53d944611 (patch) | |
| tree | 64b63d9dcb9a6239ecbc1d34b3ca627ef5955939 /include/stdbool.h | |
| parent | fb432f55a7b8bfcdc1ec4a24b1c861f15b867da5 (diff) | |
sysvsem: Fix a TOCTOU race in semctl({GET,SET}ALL)
These commands take a snapshot of the size of a semaphore set, then drop
the lock and malloc an appropriately sized array before reacquiring the
lock. A comment explains why this is (probably) safe. Unfortunately,
it's wrong; it is indeed possible for a malicious userspace to create
and destroy 2^{15} sets in the window where the lock is dropped. This
race can lead to out-of-bounds reads and writes, and that can be
exploited to elevate privileges.
Replace the assertions with runtime checks.
Approved by: so
Security: FreeBSD-SA-26:54.sysvsem
Security: CVE-2026-58087
Reported by: Maik Muench of Secfault Security
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58421
Diffstat (limited to 'include/stdbool.h')
0 files changed, 0 insertions, 0 deletions
