deadsimple BSD Security Advisories and Announcements

FreeBSD Errata Notice FreeBSD-EN-23:20.vm

Hash: SHA512

FreeBSD-EN-23:20.vm                                             Errata Notice
                                                          The FreeBSD Project

Topic:          Incorrect results from the kernel physical memory allocator

Category:       core
Module:         vm
Announced:      2023-12-05
Affects:        FreeBSD 14.0
Corrected:      2023-11-25 01:26:35 UTC (stable/14, 14.0-STABLE)
                2023-12-05 18:27:37 UTC (releng/14.0, 14.0-RELEASE-p2)

For general information regarding FreeBSD Errata Notices and Security
Advisories, including descriptions of the fields above, security
branches, and the following sections, please visit

I.   Background

The FreeBSD kernel implements a physical memory allocator which is
responsible for managing the system's RAM.  This allocator provides
interfaces which allow kernel code to request the allocation of memory which
satisifies certain constraints, such as bounds on the physical address range
for returned memory, and alignment of the returned physical pages.

One use of the physical memory allocator is to allocate memory for DMA for
device drivers, which may have special requirements.  For example, a common
constraint is that DMA memory be allocated from the lowest 4GB of the
physical address space.

II.  Problem Description

The code which implements the physical memory allocator in FreeBSD 14.0
contains a bug such that the returned physical memory may, in some
circumstances, fail to satisfy the specified constraints.

III. Impact

The effects of the bug do not have a simple characterization, as different
users of the interface may be affected differently by the bug.  In one case,
the symptom was that the affected system would occasionally panic during
boot.  It is believed that most users will be unaffected by the problem.

IV.  Workaround

No workaround is available.

V.   Solution

<insert solution here>

Upgrade your system to a supported FreeBSD stable or release / security
branch (releng) dated after the correction date.  A reboot is required
following the upgrade.

Perform one of the following:

1) To update your system via a binary patch:

Systems running a RELEASE version of FreeBSD on the amd64 or arm64 platforms,
or the i386 platfrom on FreeBSD 13 and earlier, can be updated via
the freebsd-update(8) utility:

# freebsd-update fetch
# freebsd-update install

2) To update your 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.

[FreeBSD 12.4]
# fetch
# fetch
# gpg --verify vm.patch.asc

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

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

<for a userland utility:>

c) Recompile the operating system using buildworld and installworld as
described in <URL:>.

<for a daemons>

c) Recompile the operating system using buildworld and installworld as
described in <URL:>.

Restart the applicable daemons, or reboot the system.

<for a common library>

c) Recompile the operating system using buildworld and installworld as
described in <URL:>.

Restart all daemons that use the library, or reboot the system.

<for a kernel bug:>

c) Recompile your kernel as described in
<URL:> and reboot the

VI.  Correction details

This issue is corrected as of the corresponding Git commit hash or Subversion
revision number in the following stable and release branches:

Branch/path                             Hash                     Revision
- -------------------------------------------------------------------------
stable/14/                              210fce73ae0e    stable/14-n265801
releng/14.0/                            4be96902ba82  releng/14.0-n265391
- -------------------------------------------------------------------------

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:


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

For FreeBSD 12 and earlier:

Run the following command to see which files were modified by a particular
revision, replacing NNNNNN with the revision number:

# svn diff -cNNNNNN --summarize svn://

Or visit the following URL, replacing NNNNNN with the revision number:


VII. References


The latest revision of this advisory is available at