# CVE-2026-58087: The GETALL and SETALL commands in semctl(2) recorded the number of semaphores in the target set, dropped the lock…

Source: https://junglewise.ai/threats/cve-2026-58087-the-getall-and-setall-commands-in-semctl-2-recorded-the-number-of  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-19  
License: CC BY 4.0 with a link back

CVE-2026-58087 · Severity: high · CVSS 7.8 · Published 2026-08-19

The GETALL and SETALL commands in semctl(2) recorded the number of semaphores in the target set, dropped the lock protecting the set, allocated a buffer sized for that count, and reacquired the lock.  A sequence-number check was used to verify that the set had not been replaced in the interim, but the sequence number wraps after 0x8000 create/destroy cycles.  By rapidly destroying and recreating semaphore sets at the same index, another process can cause the sequence number to wrap, allowing a set with a different number of semaphores to pass validation.  The subsequent copy then reads or writes past the end of the allocated buffer.

An unprivileged local user can trigger out-of-bounds reads and writes on kernel heap memory, potentially leading to privilege escalation.

Technologies: [Freebsd](https://junglewise.ai/threats/technologies/freebsd). Vendors: [Freebsd](https://junglewise.ai/threats/vendors/freebsd).

## Quick answers

**Is CVE-2026-58087 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-58087 being exploited in the wild.

**How severe is CVE-2026-58087?** High severity, with a CVSS score of 7.8, published 19 August 2026.

**Which products and versions are affected?** Freebsd. The advisory does not name versions.

**Is there a fix for CVE-2026-58087?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**Am I affected by CVE-2026-58087?** Check whether you run Freebsd. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Affected products

- Freebsd

## Related threats

- [FreeBSD kqueue out-of-bounds read in fork copy](https://junglewise.ai/threats/cve-2026-58100-kqueue-fork-copy-knote-indexed-into-the-child-s-file-descriptor)
- [FreeBSD kernel kqueue memory safety bugs in copy-on-fork](https://junglewise.ai/threats/cve-2026-58099-when-copying-knotes-from-a-parent-kqueue-to-a-child-the-copy-code)
- [FreeBSD kernel heap out-of-bounds access in semop(2)](https://junglewise.ai/threats/cve-2026-58098-when-semop-2-blocks-waiting-for-a-semaphore-condition-it-releases)
- [FreeBSD sound(4) use-after-free in buffer resize TOCTOU race](https://junglewise.ai/threats/cve-2026-101308-when-an-audio-channel-s-buffer-needs-to-be-resized-the-sound-4)
- [FreeBSD RACK stack buffer overflow in tcp_rack](https://junglewise.ai/threats/cve-2026-101307-when-the-pcm-sample-array-needs-to-grow-the-rack-stack-doubles-a)
