aboutsummaryrefslogtreecommitdiff
path: root/include/assert.h
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2026-07-27 15:41:30 +0000
committerMark Johnston <markj@FreeBSD.org>2026-07-29 17:48:54 +0000
commit8b08ee989506af8706a640e9881c61981a77446b (patch)
treebbe383484404a642bb8d239240d6d72751ed5656 /include/assert.h
parent825c6f45b1478a9e4afb0323841597a55199a045 (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/assert.h')
0 files changed, 0 insertions, 0 deletions