Information

Advisory XSA-369
Public release 2021-03-04 10:58
Updated 2023-12-15 15:35
Version 3
CVE(s) CVE-2021-28039
Title Linux: special config may crash when trying to map foreign pages

Files

advisory-369.txt (signed advisory file)
xsa369-linux.patch

Advisory


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

            Xen Security Advisory CVE-2021-28039 / XSA-369
                               version 3

   Linux: special config may crash when trying to map foreign pages

UPDATES IN VERSION 3
====================

Normalize version tags

ISSUE DESCRIPTION
=================

With CONFIG_XEN_BALLOON_MEMORY_HOTPLUG disabled and
CONFIG_XEN_UNPOPULATED_ALLOC enabled the Linux kernel will use guest
physical addresses allocated via the ZONE_DEVICE functionality for
mapping foreign guest's pages.

This will result in problems, as the p2m list will only cover the initial
memory size of the domain plus some padding at the end. Most ZONE_DEVICE
allocated addresses will be outside the p2m range and thus a mapping can't
be established with those memory addresses, resulting in a crash.

The attack involves doing I/O requiring large amounts of data to be
mapped by the Dom0 or driver domain.  The amount of data needed to
result in a crash can vary depending on the memory layout of the
affected Dom0 or driver domain.

IMPACT
======

A Dom0 or driver domain based on a Linux kernel (configured as
described above) can be crashed by a malicious guest administrator, or
possibly malicious unprivileged guest processes.

VULNERABLE SYSTEMS
==================

Only x86 paravirtualized (PV) Dom0 or driver domains are
affected.

Only Linux kernels configured *with* CONFIG_XEN_UNPOPULATED_ALLOC and
*without* CONFIG_XEN_BALLOON_MEMORY_HOTPLUG are vulnerable.  Only
kernels from kernel version 5.9 onwards are affected.

CONFIG_XEN_BALLOON_MEMORY_HOTPLUG is enabled by default in upstream
Linux when Xen support is enabled, so kernels using upstream default
Kconfig are not affected.  Most distribution kernels supporting Xen
dom0 use are likewise not vulnerable.

Arm systems or x86 PVH or x86 HVM driver domains are not affected.

MITIGATION
==========

There is no mitigation available.

RESOLUTION
==========

Applying the appropriate attached patch resolves this issue.

xsa369-linux.patch           Linux 5.9 - 5.12-rc

$ sha256sum xsa369*
937df4f078a070cf47bdd718c6b8a042ec6bee255eedc422d833c2ae3dd561c7  xsa369-linux.patch
$

CREDITS
=======

This issue was discovered by Marek Marczykowski-Górecki of Invisible
Things Lab.

For patch:
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

NOTE REGARDING LACK OF EMBARGO
==============================

This was reported publicly multiple times, before the XSA could be
issued.
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmV8b/sMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZaPgIAMOsfssmqWQoAfjrR8lOU8vI3qoHrTr1FlS/c8b6
Wj+Tqq0EEKrMCftyf4KgrNAJuOUCOq8z09Ub3TCr5rHqX1S1SNYIDFu+cwaLn9Em
xPv4eYSz08UdtlmaX0Q6v8kBdJ6dR1iEeDO/53Vv1reIDsy7CMIMQBUDxb6I7U4e
XZa+WjPjllHuBZ7KoMvcInAXPVKGXdQ21EPAl+tZyMSOr5po/WgljfuAyMld1B/0
22g7GB+wx9g6zVSY0dCecpPKwfIMRcKeUKo9eC32jUfw0Iyqc/kE8aa2pQKFH8yC
K2IUp56Xi/p8+E9P0TfaH1Xml7dJlcyKD6JDCoEllK4iQ9U=
=Ebsa
-----END PGP SIGNATURE-----

Xenproject.org Security Team