-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

=============================================================================
FreeBSD-SA-26:34.vt                                         Security Advisory
                                                          The FreeBSD Project

Topic:          Integer overflow in vt(4) CONS_HISTORY ioctl

Category:       core
Module:         vt
Announced:      2026-06-09
Credits:        Ed Maste
Affects:        All supported versions of FreeBSD
Corrected:      2026-06-07 17:10:53 UTC (stable/15, 15.1-STABLE)
                2026-06-09 19:20:14 UTC (releng/15.1, 15.1-RC3-p1)
                2026-06-09 19:19:53 UTC (releng/15.0, 15.0-RELEASE-p10)
                2026-06-07 17:12:28 UTC (stable/14, 14.4-STABLE)
                2026-06-09 19:19:15 UTC (releng/14.4, 14.4-RELEASE-p6)
                2026-06-09 19:18:45 UTC (releng/14.3, 14.3-RELEASE-p15)
CVE Name:       CVE-2026-49416

For general information regarding FreeBSD Security Advisories,
including descriptions of the fields above, security branches, and the
following sections, please visit <URL:https://security.FreeBSD.org/>.

I.   Background

vt(4) is FreeBSD's default system console driver.  It provides virtual
terminals on the physical console, including a scrollback history buffer.
The CONS_HISTORY ioctl(2) allows a user to resize the scrollback history of
a virtual terminal.

II.  Problem Description

The CONS_HISTORY ioctl handler did not adequately validate the requested
history size.  A large value caused an integer overflow in the buffer size
calculation, resulting in a heap allocation smaller than expected.
Subsequent initialization of the buffer wrote beyond the end of the
allocation.

III. Impact

An unprivileged local user with access to a vt(4) device can trigger an
out-of-bounds write in the kernel, potentially escalating privileges.

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 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:34/vt.patch
# fetch https://security.FreeBSD.org/patches/SA-26:34/vt.patch.asc
# gpg --verify vt.patch.asc

b) Apply the patch.  Execute the following commands as root:

# cd /usr/src
# patch < /path/to/patch

c) Recompile your kernel as described in
<URL:https://www.FreeBSD.org/handbook/kernelconfig.html> 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/                              deaaddf1d3c4    stable/15-n283854
releng/15.1/                            8ed11b21e544  releng/15.1-n283558
releng/15.0/                            f4cf977dfe92  releng/15.0-n281061
stable/14/                              b5a4f4bfbc95    stable/14-n274300
releng/14.4/                            799e830134d5  releng/14.4-n273723
releng/14.3/                            9cba21c2de16  releng/14.3-n271523
- -------------------------------------------------------------------------

Run the following command to see which files were modified by a
particular commit:

# git show --stat <commit hash>

Or visit the following URL, replacing NNNNNN with the hash:

<URL:https://cgit.freebsd.org/src/commit/?id=NNNNNN>

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

<URL:https://www.cve.org/CVERecord?id=CVE-2026-49416>

The latest revision of this advisory is available at
<URL:https://security.FreeBSD.org/advisories/FreeBSD-SA-26:34.vt.asc>
-----BEGIN PGP SIGNATURE-----

iQJPBAEBCgA5FiEEthUnfoEIffdcgYM7bljekB8AGu8FAmooiW4bFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMCwzAAoJEG5Y3pAfABrvpd8P/0WOqL3COrZKAvzgZO+u
tOfo4MhWYDw+jMAHtFLU5qH6GNfgUA8j5OaLaN1Rf+Z0+UNyy6CC5wehumdzRHm8
dPdfW9mKA932rsrOMM5/RtgLmBjVok4VjzC+KZbpO2b2cEJN5Tq1ZIYqZyvhbUV5
ZXjgdTZ1w2osE7IzPK2v0OOCRh+uiVLjpBiE4M18K0bmsnEytHm3xOpUUIkSNGWe
gwunylrC0FstCKI778agymVHf4LX/xzEm7E62B4Ydk21GbB5QEx8ZnOOWWY8OehJ
O48CBQILxnsIYSySx258nO9K8SwrZ45IonJmxb+N1OTTl+qDeSQo9Wfw2zTR4YZl
qBBXpl9Ra/dL4zOGM0HOBEwlOXruCC4vm84vipZowJwO5e97/XZVdhNhkU8HHNWO
256nEIRwAFx/KqJ63AseOsq6REIP6hhCLo8NyWqLYpdp0MGClZ7UBQ5ay6TvwVHD
Qf+KyZrfGh6q7pU2ADmLdzf0H6FiUASsbPiRjcd5o/T4qPY9vJKJGOfd8EVHqzsH
Rh2yhdtbsbCqTvfOjnUIuj5vJnk3sr/HG9wJXNqEgLcBz33/jmNaNhHXcyc2Yw9N
7lBHW20nj3jDFhK8MdKSvBUZ4WSmr8yBYb85v4L6kb9EKDiUQMa7eJ6cCaHYYRff
NH418v0qjh1t7fJRdmx1HtvQ
=ZGXy
-----END PGP SIGNATURE-----
