Bug 1211433 (CVE-2022-42336) - VUL-0: CVE-2022-42336: xen: Mishandling of guest SSBD selection on AMD hardware (XSA-431)
Summary: VUL-0: CVE-2022-42336: xen: Mishandling of guest SSBD selection on AMD hardwa...
Status: RESOLVED FIXED
Alias: CVE-2022-42336
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Security Team bot
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/366641/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-16 15:36 UTC by Gianluca Gabrielli
Modified: 2024-05-07 11:38 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
xsa431 patch (3.32 KB, patch)
2023-05-16 15:36 UTC, Gianluca Gabrielli
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gianluca Gabrielli 2023-05-16 15:36:33 UTC
Created attachment 867063 [details]
xsa431 patch

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

The current logic to set SSBD on AMD Family 17h and Hygon Family 18h
processors requires that the setting of SSBD is coordinated at a core
level, as the setting is shared between threads.  Logic was introduced
to keep track of how many threads require SSBD active in order to
coordinate it, such logic relies on using a per-core counter of threads
that have SSBD active.

When running on the mentioned hardware, it's possible for a guest to
under or overflow the thread counter, because each write to
VIRT_SPEC_CTRL.SSBD by the guest gets propagated to the helper that does
the per-core active accounting.  Underflowing the counter causes the
value to get saturated, and thus attempts for guests running on the same
core to set SSBD won't have effect because the hypervisor assumes it's
already active.

IMPACT
======

An attacker with control over a guest can mislead other guests into
observing SSBD active when it is not.

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

Only Xen version 4.17 is vulnerable.

Only x86 AMD systems are vulnerable.  The vulnerability can be leveraged
by and affects only HVM guests.

MITIGATION
==========

Running PV guests only will prevent the vulnerability.

Setting `spec-ctrl=ssbd` on the hypervisor command line will force SSBD
to be unconditionally active.

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

This issue was discussed in public already.

RESOLUTION
==========

Applying the attached patch resolves this issue.

Note that patches for released versions are generally prepared to
apply to the stable branches, and may not apply cleanly to the most
recent release tarball.  Downstreams are encouraged to update to the
tip of the stable branch before applying these patches.

xsa431.patch           xen-unstable - Xen 4.17.x

$ sha256sum xsa431*
e71a8b7e251adf4832a4de9e452c2fd895a56314729c54698d10e344f1996a99  xsa431.patch
Comment 1 Gianluca Gabrielli 2023-05-17 11:54:37 UTC
Affected codestreams:
 - SUSE:SLE-15-SP5:Update/xen
 - openSUSE:Factory/xen
Comment 3 OBSbugzilla Bot 2023-05-25 18:35:03 UTC
This is an autogenerated message for OBS integration:
This bug (1211433) was mentioned in
https://build.opensuse.org/request/show/1089051 Factory / xen
Comment 4 Charles Arnold 2023-06-05 20:31:48 UTC
This has been submitted to Factory and 15-SP5
Comment 5 Maintenance Automation 2023-06-19 08:30:25 UTC
SUSE-SU-2023:2535-1: An update that solves two vulnerabilities and has five fixes can now be installed.

Category: security (important)
Bug References: 1027519, 1208736, 1209237, 1209245, 1210315, 1210570, 1211433
CVE References: CVE-2022-42335, CVE-2022-42336
Sources used:
openSUSE Leap 15.5 (src): xen-4.17.1_04-150500.3.3.1
Basesystem Module 15-SP5 (src): xen-4.17.1_04-150500.3.3.1
Server Applications Module 15-SP5 (src): xen-4.17.1_04-150500.3.3.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 7 Robert Frohl 2024-05-07 11:38:29 UTC
done, closing