[FreeBSD-Announce] FreeBSD Errata Notice FreeBSD-EN-18:07.pmap

FreeBSD Errata Notices errata-notices at freebsd.org
Thu Jun 21 06:02:08 UTC 2018

Hash: SHA512

FreeBSD-EN-18:07.pmap                                           Errata Notice
                                                          The FreeBSD Project

Topic:          Incorrect TLB shootdown for Xen based guests

Category:       core
Module:         kernel
Announced:      2018-06-21
Credits:        Colin Percival
Affects:        FreeBSD 11.1
Corrected:      2018-05-22 14:36:46 UTC (stable/11, 11.2-BETA2)
                2018-06-21 05:18:08 UTC (releng/11.1, 11.1-RELEASE-p11)

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

CPUs rely on a Translation Lookaside Buffer (TLB) to cache virtual memory
paging information.  When a page is unmapped from the virtual address space
of a process on a multiprocessor system, an Inter-Processor Interrupt (IPI)
may be sent to instruct other CPUs to invalidate ("shoot down") their TLB
entries for the addresses in question.

For virtualization-related performance reasons, FreeBSD has IPI code for the
Xen platform which is separate from the generic x86 IPI code.

II.  Problem Description

In the course of changes to the FreeBSD virtual memory system to address
FreeBSD-SA-18:03.speculative_execution, changes were made to the IPIs used
for shooting down TLB entries.  Unfortunately, the IPI handlers for Xen were
left non-PTI, even when PTI was enabled, which result in TLB shootdowns for
the user mode portion of the address space not being consistently performed

III. Impact

Processes on Xen based guests may "see" pages of memory which were previously
mapped but have since been unmapped, resulted in data being corrupted and/or
processes crashing due to internal data structures becoming inconsistent.

IV.  Workaround

Only Xen based guests are affected by this issue.  All other platforms are
not susceptible.

For Xen based guests, disabling PTI will workaround the issue.  Add the
following line to /boot/loader.conf:

Please be aware, by disabling PTI, the system will be vulnerable to

V.   Solution

Perform one of the following:

1) Upgrade your system to a supported FreeBSD stable or release / security
branch (releng) dated after the correction date.

Afterward, reboot the system.

2) To update your system via a binary patch:

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

# freebsd-update fetch
# freebsd-update install

Afterward, reboot the system.

3) 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 11.1]
# fetch https://security.FreeBSD.org/patches/EN-18:07/pmap.patch
# fetch https://security.FreeBSD.org/patches/EN-18:07/pmap.patch.asc
# gpg --verify pmap.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                                                      Revision
- -------------------------------------------------------------------------
stable/11/                                                        r334047
releng/11.1/                                                      r335466
- -------------------------------------------------------------------------

To see which files were modified by a particular revision, run the
following command, replacing NNNNNN with the revision number, on a
machine with Subversion installed:

# 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 notice is available at


More information about the freebsd-announce mailing list