deadsimple BSD Security Advisories and Announcements

FreeBSD Errata Notice FreeBSD-EN-23:08.vnet

Hash: SHA512

FreeBSD-EN-23:08.vnet                                           Errata Notice
                                                          The FreeBSD Project

Topic:          VNET and DPCPU module panic on arm64

Category:       core
Module:         kernel
Announced:      2023-08-01
Affects:        FreeBSD 13.2
Corrected:      2023-07-26 18:03:46 UTC (stable/13, 13.2-STABLE)
                2023-08-01 19:50:47 UTC (releng/13.2, 13.2-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

VNET is the name of a technique to virtualize the network stack. It changes
global resources, most notably variables, into per network stack resources
and handles them in the context of the correct instance. VNET is enabled by
default in GENERIC kernels on all architectures except 32-bit ARM.

DPCPU is a dynamic per-CPU memory allocator which can instantiate one
instance of a global variable with each CPU in the system. Dynamically
allocated per-CPU variables can be defined with custom names and types.
DPCPU is always enabled.

II.  Problem Description

After FreeBSD 13.1 was released, the contributed LLVM components (LLVM,
clang, compiler-rt, libc++, libunwind, lld, lldb and openmp) were
upgraded to upstream version 14.0.5. The new version of lld, the llvm
linker, got additional optimizations for arm64 in the form of so-called
relocation relaxations.

These relaxations are fine for regular userland applications, as the
dynamic linker can handle the optimized relocations. However, due to the
way the VNET and DPCPU features are implemented, the optimized
relocations can cause panics if they are used in kernel modules.

III. Impact

On arm64 systems, loading kernel modules that use VNET or DPCPU features can
cause panics. A known example is the WireGuard kernel module, if_wg(4).

IV.  Workaround

No workaround is available.

V.   Solution

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

A reboot is required, because the kernel and several kernel modules are

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

A reboot is required, because the kernel and several kernel modules are updated.

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
# fetch
# gpg --verify vnet.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:> and reboot the

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/                              98e7f836e65e    stable/13-n255888
releng/13.2/                            e3e6fc371322  releng/13.2-n254623
- -------------------------------------------------------------------------

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

VII. References



The latest revision of this advisory is available at