Hash: SHA512

FreeBSD-EN-21:25.bhyve                                          Errata Notice
                                                          The FreeBSD Project

Topic:          Fix NVMe iovec construction for large IOs

Category:       core
Module:         bhyve
Announced:      2021-08-24
Affects:        FreeBSD 12.2 and later.
Corrected:      2021-07-09 14:24:14 UTC (stable/13, 13.0-STABLE)
                2021-08-24 17:25:47 UTC (releng/13.0, 13.0-RELEASE-p4)
                2021-07-09 14:25:45 UTC (stable/12, 12.2-STABLE)
                2021-08-24 18:32:11 UTC (releng/12.2, 12.2-RELEASE-p10)

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

bhyve(8) is a hypervisor that supports running a variety of guest
operating systems in virtual machines.  Newer UEFI code in Red Hat
Enterprise Linux (RHEL) 8.4 and later (as well as applicable variants)
will not boot in newly installed guests.

II.  Problem Description

By default, NVMe data transfer operations use a scatter-gather list in
which all entries point to a fixed-size memory region.  For example, if
the memory page size is 4KB, a 2MB IO requires 512 entries.  Lists
themselves are also fixed in size (default is 512 entries).

Because the list size is fixed, the last entry is special.  If the IO
requires more than 512 entries, the last entry in the list contains the
address of the next list of entries.  But if the IO requires exactly 512
entries, the last entry points to data.

The NVMe emulation missed this logic and unconditionally treated the
last entry as a pointer to the next list.

III. Impact

When a RHEL 8.4 and later (or variants) are installed as guests within
bhyve(8) on emulated NVMe storage, the system will not boot due to a
newer UEFI driver that is included with these distributions.

IV.  Workaround

Installation of a RHEL 8.3 guest and performing an in-place upgrade.

V.   Solution

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

Perform one of the following:

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

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.

# fetch https://security.FreeBSD.org/patches/EN-21:25/bhyve.patch
# fetch https://security.FreeBSD.org/patches/EN-21:25/bhyve.patch.asc
# gpg --verify bhyve.patch.asc

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

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

c) Recompile the operating system using buildworld and installworld as
described in <URL:https://www.FreeBSD.org/handbook/makeworld.html>.

VI.  Correction details

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

Branch/path                             Hash                     Revision
- -------------------------------------------------------------------------
stable/13/                              a7761d19dacd    stable/13-n246220
releng/13.0/                            4f590ee3ed7e  releng/13.0-n244755
stable/12/                                                        r370107
releng/12.2/                                                      r370392
- -------------------------------------------------------------------------

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 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://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

freebsd-announce@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-announce-unsubscr...@freebsd.org"

Reply via email to