-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
=============================================================================
FreeBSD-SA-26:64.sysvsem Security Advisory
The FreeBSD Project
Topic: Heap out-of-bounds access in semop(2)
Category: core
Module: sysvsem
Announced: 2026-09-29
Credits: Reo Shiseki
Credits: Andrew Griffiths
Affects: All supported versions of FreeBSD.
Corrected: 2026-09-29 15:56:17 UTC (stable/15, 15.1-STABLE)
2026-09-29 16:00:02 UTC (releng/15.1, 15.1-RELEASE-p4)
2026-09-29 15:59:12 UTC (releng/15.0, 15.0-RELEASE-p14)
2026-09-29 15:56:36 UTC (stable/14, 14.5-STABLE)
2026-09-29 16:09:04 UTC (releng/14.5, 14.5-RELEASE-p1)
2026-09-29 15:57:26 UTC (releng/14.4, 14.4-RELEASE-p10)
CVE Name: CVE-2026-58098
For general information regarding FreeBSD Security Advisories,
including descriptions of the fields above, security branches, and the
following sections, please visit .
I. Background
System V semaphores are a kernel-provided Inter-Process Communication
(IPC) mechanism that allows processes to synchronize using sets of
integer counters.
The semop(2) system call performs atomic operations on a semaphore set,
and may block the calling process until the requested conditions are
met.
II. Problem Description
When semop(2) blocks waiting for a semaphore condition, it releases the
per-set lock and sleeps. Upon waking, it checks the sequence number
embedded in the semaphore set's IPC identifier to detect whether the
set was removed while the caller was asleep. This sequence number is
only 15 bits wide. If enough semaphore sets are created and destroyed
in the same table slot while a caller is blocked, the counter wraps
around, and semop(2) may falsely conclude that the original set still
exists. The subsequent access to a semaphore within the set may then
be out of bounds.
III. Impact
An unprivileged local user can trigger an out-of-bounds access on kernel
heap memory, potentially leading to privilege escalation.
IV. Workaround
No workaround is available.
V. Solution
Upgrade your vulnerable system to a supported FreeBSD stable or
release / security branch (releng) dated after the correction date,
and reboot the system.
Perform one of the following:
1) To update your vulnerable system installed from base system packages:
Systems running a 15.0-RELEASE or later version of FreeBSD on the amd64 or
arm64 platforms, which were installed using base system packages, can be
updated via the pkg(8) utility:
# pkg upgrade -r FreeBSD-base
# shutdown -r +10min "Rebooting for a security update"
2) To update your vulnerable system installed from binary distribution sets:
Systems running a RELEASE version of FreeBSD on the amd64 or arm64 platforms
which were not installed using base system packages can be updated via the
freebsd-update(8) utility:
# freebsd-update fetch
# freebsd-update install
# shutdown -r +10min "Rebooting for a security update"
3) To update your vulnerable system via a source code patch:
The following patches have been verified to apply to the applicable
FreeBSD release branches.
a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.
# fetch https://security.FreeBSD.org/patches/SA-26:64/sysvsem.patch
# fetch https://security.FreeBSD.org/patches/SA-26:64/sysvsem.patch.asc
# gpg --verify sysvsem.patch.asc
b) Apply the patch. Execute the following commands as root:
# cd /usr/src
# patch -E -p0 < /path/to/patch
c) Recompile your kernel as described in
and reboot the
system.
VI. Correction details
This issue is corrected as of the corresponding Git commit hash in the
following stable and release branches:
Branch/path Hash Revision
- -------------------------------------------------------------------------
stable/15/ 8063b1b61ae8 stable/15-n285676
releng/15.1/ aff64c19ebb8 releng/15.1-n283615
releng/15.0/ fc5c2fd47117 releng/15.0-n281116
stable/14/ 04f841a05836 stable/14-n275239
releng/14.5/ a412d0c46d36 releng/14.5-n274875
releng/14.4/ 9bb6f92b5d1b releng/14.4-n273768
- -------------------------------------------------------------------------
Run the following command to see which files were modified by a
particular commit:
# git show --stat
Or visit the following URL, replacing NNNNNN with the hash:
To determine the commit count in a working tree (for comparison against
nNNNNNN in the table above), run:
# git rev-list --count --first-parent HEAD
VII. References
The latest revision of this advisory is available at
-----BEGIN PGP SIGNATURE-----
iQJPBAEBCgA5FiEEthUnfoEIffdcgYM7bljekB8AGu8FAmq8DLEbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMCwzAAoJEG5Y3pAfABrvqGMP/0xCX38+MfKT4kb/Q6Bs
3V+xYOL4pl8qN6Aht96T+ViIRW3bStGlWvWZDDo3t8DE8JJ0tnbHv5kntc0koCRa
COPNpB0Q/rM3cVC6S5HC/bYBRHK4kawFf9XYw6KRWRRTbc9bV941XlNPpKulITIe
DNQtx9mewN1XiLAmEp0qWW83z60wjYVugjwLMGfzeT8llhhWxJxPymLE3UWfSDe4
xbK6SlFfxHkNhu+mTpgHNvaS0Ct9v+f2NcL0SRo5LP+K0WfNrAus17HsMgjKBEfH
UzMCkJhd/SZbhm6dv5SQylaeEChCHSSEUmwBGV2Ly3UEDXeELHv11WeP7E30XozT
75pDMm1/t/FUCkOJdzGxThvbvpEV3jbbfZllAqcAhcr6dzO6aT/7lP2eTE2Rng4s
QV9guxAqAyAb1EXPUxzKftKV358FjJbWlCbrp/Tdwi0E50zhBemvDeySN5cAlUZl
4RsPZ6VXkUkHTDPZqf/mvoeYRLJFe7CrPlfUrAJWpS71+AU3CGUIYd5070PDqqnd
8IV8VMU0gB51gYZpCC0q/ewe1b8rHT8AOC6HRXZPF2fYtE0IpctuPfqSNTKQKpnb
vxA8DowZDCYS8I1YKg15lF6NEhSQKETIpmDmcSpQcgu8oQPZsrxZDE4Qnzfv5YgT
FWO42b+ROUo2BQKMEXHiWz5E
=mm5X
-----END PGP SIGNATURE-----