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

===========================================================================
             AUSCERT External Security Bulletin Redistribution

                               ESB-2019.4495
          Device quarantine for alternate pci assignment methods
                             27 November 2019

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:           Xen
Publisher:         Xen project
Operating System:  UNIX variants (UNIX, Linux, OSX)
                   Windows
Impact/Access:     Increased Privileges -- Console/Physical
Resolution:        Patch/Upgrade

Original Bulletin: 
   http://xenbits.xen.org/xsa/advisory-306.html

- --------------------------BEGIN INCLUDED TEXT--------------------

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

                    Xen Security Advisory XSA-306
                              version 2

        Device quarantine for alternate pci assignment methods

UPDATES IN VERSION 2
====================

Public release.

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

XSA-302 relies on the use of libxl's "assignable-add" feature to
prepare devices to be assigned to untrusted guests.

Unfortunately, this is not considered a strictly required step for
device assignment.  The PCI passthrough documentation on the wiki
describes alternate ways of preparing devices for assignment, and
libvirt uses its own ways as well.  Hosts where these "alternate"
methods are used will still leave the system in a vulnerable state
after the device comes back from a guest.

IMPACT
======

An untrusted domain with access to a physical device can DMA into host
memory, leading to privilege escalation.

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

Only systems where guests are given direct access to physical devices
capable of DMA (PCI pass-through) are vulnerable.  Systems which do
not use PCI pass-through are not vulnerable.

Only systems which use "alternate" methods to assign devices to pciback
before assignment are vulnerable.  These methods include:
 - Assigning devices on the Linux command-line using `xen-pciback.hide`
 - Assigning devices via xen-pciback module parameters
 - Assigning devices manually via sysfs
 - Assigning devices using libvirt

Systems which use `xl pci-assignable-add` or
libxl_device_pci_assignable_add, or have the assignable state handled
automatically via setting the `seize` parameter, are not affected.

MITIGATION
==========

For xl and libvirt, before assigning a device to a guest, manually run
`xl pci-assignable-add`.  This will quarantine the device even if the
device has already been assigned to pciback by one of the alternate
methods.  This may also work for other libxl-based toolstacks,
depending on the particular implementation.

CREDITS
=======

This issue was discovered by Marek Marczykowski-Gorecki of Invisible
Things Lab.

RESOLUTION
==========

Applying the appropriate attached patch resolves this issue.

Note that this patch will quarantine the device after the domain is
destroyed by default.  It must be un-quarantined before it can be used
by domain 0 again.  This can be done by executing `xl
pci-assignable-remove`.  This will be effective even if the device was
assigned to pciback with one of the alternate methods.

xsa306.patch           xen-unstable
xsa306-4.12.patch      Xen 4.12.x
xsa306-4.11.patch      Xen 4.11.x, Xen 4.10.x
xsa306-4.9.patch       Xen 4.9.x, Xen 4.8.x

$ sha256sum xsa306*
07468dcdfbe34b794fd0618bce7d6d1edb6b10b234dccf1e5dd1f1120a0affe7  xsa306.meta
3534ec46f03bb8dac3011e0e3739fc75400559078e4361bbe5385d97b7892650  xsa306.patch
426e32bfa7d7787fe6778685e623966f8762857f7920443a0ca73347df9d6624  xsa306-4.9.patch
b00e58c9f96b0ff654dfd4904c675a54356148af718eb9b2adca0253b900dfc1  xsa306-4.11.patch
69857d08969903452fbf009905a145e06a5aef9966e969de9fbb22e62c557ffd  xsa306-4.12.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.


(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
- -----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAl3dE7EMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZdj0H/1MUzg8URNtE5FsG5Q0OwszcNXSuV1qW9B6mZCRJ
ffGyGtTmhM2M/KXao9j15Hn83BVxTh5iFVkmZ9LoQSFiwu4L9nhx8KGw+nnspb9G
v2+NrEbZRpxbloPxDplMfWLx1/GNFCs+wK550LtGC+yzITqMckacD6cTkbEGmIwR
otLTU3JTlfwMnvhZraDzVrICyX/+vNri9EvHd7Tviz1yXk83QMapgZ+xJCocUY3n
kA93XN2yG/xFB0jHky75wBT2HFRR1RpmLECSodiOP0ONLPJiRBl3O2ziqb8OtdRD
mkMvTMWEJawTPiWKc5CS4ieD2YyiUngFC806r2LDpRk6468=
=gi2B
- -----END PGP SIGNATURE-----

- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

NOTE: Third Party Rights
This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:

        https://www.auscert.org.au/bulletins/

===========================================================================
Australian Computer Emergency Response Team
The University of Queensland
Brisbane
Qld 4072

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business hours
                which are GMT+10:00 (AEST).
                On call after hours for member emergencies only.
===========================================================================
-----BEGIN PGP SIGNATURE-----
Comment: http://www.auscert.org.au/render.html?it=1967

iQIVAwUBXd4KemaOgq3Tt24GAQhxixAAueIJGl9pupX5dQuvv25lo6pRa3D6YKYQ
XzITXkDHDsrpkW6lz1jc/LXHhDeC7p8R71sJVfXoraGfWhFnFaa21XyiqgsyfMui
TsHW2Juh1WG7ofkslBFkd2UkntxEkdv7HoyhdOZw8rNKvTAnF4pU9haHcB+4Ck0r
DuxN6iEU7YgLGPeIQwCBu7iMNhol2TnkrdeFQsiYliWeuSUs9EisRs/ZsvBGld5w
iqgX9432huOdQ3QQu4tNZjNBP4WLA/Gm+NX5vjPFIsVs2FlXd+7PgM9v0LxlQViX
mjGao30ypjoR98VTvc5chUeZANFv3vXHXQkfNyvquieJ0i9yFf1TU2pmAI+YoI3t
LGXirmizqaJL7p2qTm0tH/0ofdcUzifPcXRMd7crjamm8InjiUTrjSbkbJokPpSV
m2mg88K1b8CJ/pqrs38MAec+bloTAjRzhtu3/QyW48g2G8foB5+mC/1ZI47N023r
CczS9zTWKOk766A9nOb7aE7On7VPU7rZ6Ii/4ZGBALhZe3bSQKWwO1+T2qxhIB0n
ewXMmJ0EUU/pksiFbBGoGcG0FafBhx0d8ur931qmTh2P9NdqlDWjw6kyfUp54cRt
lF7ib71YTt9qDPqCXcuW5L7a7xaWTX6mW3kE3BxOv74KXsiFSlFgGs/a0A3N2dLv
ab74zySVCkw=
=Se/d
-----END PGP SIGNATURE-----