[FreeBSD-Announce] FreeBSD Errata Notice FreeBSD-EN-17:05.xen

FreeBSD Errata Notices errata-notices at freebsd.org
Wed Apr 12 07:23:52 UTC 2017

Hash: SHA512

FreeBSD-EN-17:05.xen                                            Errata Notice
                                                          The FreeBSD Project

Topic:          Xen migration enhancements

Category:       core
Module:         xen
Announced:      2017-04-12
Credits:        Citrix Systems R&D, Huawei Technologies
Affects:        All supported versions of FreeBSD.
Corrected:      2017-03-21 08:38:12 UTC (stable/11, 11.0-STABLE)
                2017-04-12 06:24:35 UTC (releng/11.0, 11.0-RELEASE-p9)
                2017-03-29 17:11:41 UTC (stable/10, 10.3-STABLE)
                2017-04-12 06:24:35 UTC (releng/10.3, 10.3-RELEASE-p18)

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

FreeBSD when running as a Xen guest supports live-migration, that means being
able to move from one physical Xen host to another without interruption of

Due to the lack of ordering during the resume procedure devices might try to
use the Xen PV timer before it's correctly resumed, leading to unexpected

II.  Problem Description

There are three issues that currently prevent FreeBSD from working reliably under
heavy live-migration stress:

1. FreeBSD cannot recover from a failed live migration. It is a Xen feature to
fail a live migration, which means the VM will continue running on the same
host. FreeBSD was not capable of coping with this situation.

[This is https://reviews.freebsd.org/D9635]

2. User-space processes that make use of the xenstore device
(/dev/xen/xenstore) might manage to lock-up the resume procedure, preventing
the kernel from resuming correctly after a live-migration.

[This is https://reviews.freebsd.org/D9638]

3. The Xen PV timer is attached to the xenpv bus on FreeBSD 11.0, and the xenpv
bus itself is attached after the PCI bus and other buses. This means that the
Xen PV timer is also resume quite late, and device drivers might try to use the
timer before it's resumed correctly, leading to erratic behavior or lockups.

III. Impact

FreeBSD 10.3 and 11.0 are affected by the 1. and 2. issues when being migrated
as a Xen guest.

Only FreeBSD 11.0 is affected when live-migrated as a Xen guest.

IV.  Workaround

Not attempting to use live-migration when running as a Xen guest will prevent
those issues.

Not having user-space processes will prevent issue 2. from happening.

For issue 3, the administrator can switch to a different timer, like the TSC, if
there is plan to migrate the VM:

# sysctl -a | grep timecounter.choice
kern.timecounter.choice: XENTIMER(950) ACPI-safe(850) i8254(0) TSC-low(-100) dummy(-1000000)
# sysctl -w kern.timecounter.hardware=TSC-low

V.   Solution

Issue 1. has been solved by adding the proper logic in FreeBSD in order to
recover from failed live migrations.

Issue 2. has been resolved by adding xenstore locking around the suspend
procedure, in order to make sure no user-space process is holding the xenstore
lock when going into suspension.

Issue 3. has been solved by marking the Xen PV timer as not safe for suspension
until the order issues can be solved.

Perform one of the following:

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

A reboot is required.

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

A reboot is required.

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.0]
# fetch https://security.FreeBSD.org/patches/EN-17:05/xen-11.0.patch
# fetch https://security.FreeBSD.org/patches/EN-17:05/xen-11.0.patch.asc
# gpg --verify xen-11.0.patch.asc

[FreeBSD 10.3]
# fetch https://security.FreeBSD.org/patches/EN-17:05/xen-10.3.patch
# fetch https://security.FreeBSD.org/patches/EN-17:05/xen-10.3.patch.asc
# gpg --verify xen-10.3.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/10/                                                        r316170
releng/10.3/                                                      r316722
stable/11/                                                        r315668
releng/11.0/                                                      r316722
- -------------------------------------------------------------------------

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 advisory is available at
Version: GnuPG v2.1.19 (FreeBSD)


More information about the freebsd-announce mailing list