[FreeBSD-Announce] FreeBSD Security Advisory FreeBSD-SA-21:08.vm

FreeBSD Security Advisories security-advisories at freebsd.org
Tue Apr 6 20:22:58 UTC 2021

Hash: SHA512

FreeBSD-SA-21:08.vm                                         Security Advisory
                                                          The FreeBSD Project

Topic:          Memory disclosure by stale virtual memory mapping

Category:       core
Module:         vm
Announced:      2021-04-06
Credits:        Ryan Libby, Dell Inc.
Affects:        All supported versions of FreeBSD.
Corrected:      2021-04-06 18:50:46 UTC (stable/13, 13.0-STABLE)
                2021-04-06 19:18:49 UTC (releng/13.0, 13.0-RC5-p1)
                2021-04-06 19:20:46 UTC (stable/12, 12.2-STABLE)
                2021-04-06 19:21:30 UTC (releng/12.2, 12.2-RELEASE-p6)
                2021-04-06 19:22:31 UTC (stable/11, 11.4-STABLE)
                2021-04-06 19:22:56 UTC (releng/11.4, 11.4-RELEASE-p9)
CVE Name:       CVE-2021-29626

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

Memory mappings shared between processes are a feature of the FreeBSD
virtual memory system.  They may be established by unprivileged
processes with the mmap(2), fork(2), and other system calls.

II.  Problem Description

A particular case of memory sharing is mishandled in the virtual memory
system.  It is possible and legal to establish a relationship where
multiple descendant processes share a mapping which shadows memory of an
ancestor process.  In this scenario, when one process modifies memory
through such a mapping, the copy-on-write logic fails to invalidate
other mappings of the source page.  These stale mappings may remain even
after the mapped pages have been reused for another purpose.

III. Impact

An unprivileged local user process can maintain a mapping of a page
after it is freed, allowing that process to read private data belonging
to other processes or the kernel.

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.

Perform one of the following:

1) To update your vulnerable system via a binary patch:

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

# freebsd-update fetch
# freebsd-update install
# shutdown -r +10min "Rebooting for a security update"

2) 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.

[FreeBSD 13.0]
# fetch https://security.FreeBSD.org/patches/SA-21:08/vm_fault.13.patch
# fetch https://security.FreeBSD.org/patches/SA-21:08/vm_fault.13.patch.asc
# gpg --verify vm_fault.13.patch.asc

[FreeBSD 12.2]
# fetch https://security.FreeBSD.org/patches/SA-21:08/vm_fault.12.patch
# fetch https://security.FreeBSD.org/patches/SA-21:08/vm_fault.12.patch.asc
# gpg --verify vm_fault.12.patch.asc

[FreeBSD 11.4]
# fetch https://security.FreeBSD.org/patches/SA-21:08/vm_fault.11.patch
# fetch https://security.FreeBSD.org/patches/SA-21:08/vm_fault.11.patch.asc
# gpg --verify vm_fault.11.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

VI.  Correction details

The following list contains the correction revision numbers for each
affected branch.

Branch/path                      Hash                            Revision
- -------------------------------------------------------------------------
stable/13/                       2e08308d62f3           stable/13-n245117
releng/13.0/                     724bc23da1a9         releng/13.0-n244728
stable/12/                                                        r369551
releng/12.2/                                                      r369556
stable/11/                                                        r369559
releng/11.4/                                                      r369561
- -------------------------------------------------------------------------

For FreeBSD 13 and later:

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 HHHHHH 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://svn.freebsd.org/base

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


VII. References


The latest revision of this advisory is available at


More information about the freebsd-announce mailing list