Bug 1284911 (CVE-2015-8338, xsa158)

Summary: CVE-2015-8338 xen: Long running memory operations on ARM cause DoS
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: agordeev, ailan, aquini, bhu, blc, dhoward, drjones, esammons, fhrbata, hkrzesin, hwkernel-mgr, iboverma, imammedo, jkacur, jross, kernel-mgr, knoel, lgoncalv, lwang, matt, mcressma, mguzik, mlangsdo, mrezanin, nmurray, osoukup, pbonzini, plougher, rkrcmar, rt-maint, rvrbovsk, security-response-team, vkuznets, williams, xen-maint
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
A flaw was discovered in xen host that prevented the use of a physical CPU for a significant period of time. This can cause a softlockup or watchdog timeout in both the host and other guests.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-19 09:52:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1289568    
Bug Blocks: 1284949    
Attachments:
Description Flags
xen-unstable, Xen 4.6.x, Xen 4.5.x
none
Xen 4.4.x, Xen 4.3.x none

Description Adam Mariš 2015-11-24 12:59:14 UTC
Certain HYPERVISOR_memory_op subops take page order inputs, with so far insufficient enforcement of limits thereof. In particular, for all of XENMEM_increase_reservation, XENMEM_populate_physmap, and XENMEM_exchange the order was limited to 9 only for guests without physical devices assigned. Guests with assigned devices were allowed up to order 18 (x86) or 20 (ARM). XENMEM_decrease_reservation enforced only the latter, higher limit uniformly on all kinds of guests.

All of these operations involve loops over individual pages (possibly nested, with only the iteration count of the innermost loop being of interest here), resulting in iteration counts of up to 1 million on ARM. Total execution time of these operations obviously depends on system speed, but have been measured to get into the seconds range.

A malicious guest administrator can cause a denial of service. Specifically, prevent use of a physical CPU for a significant period. Other attacks, namely privilege escalation, cannot be ruled out.

If a host watchdog (Xen or dom0) is in use, this can lead to a watchdog timeout and consequently a reboot of the host. If another, innocent, guest, is configured with a watchdog, this issue can lead to a reboot of such a guest.

All Xen versions supporting ARM are affected.

The vulnerability can be avoided if the guest kernel is controlled by the host rather than guest administrator, provided that further steps are taken to prevent the guest administrator from loading code into the kernel (e.g. by disabling loadable modules etc) or from using other mechanisms which allow them to run code at kernel privilege. On ARM, controlling the guest's kernel may involve locking down the bootloader.

Exposure may be limited by not passing through physical devices to untrusted guests.

Comment 1 Adam Mariš 2015-11-24 13:19:11 UTC
Created attachment 1098193 [details]
xen-unstable, Xen 4.6.x, Xen 4.5.x

Comment 2 Adam Mariš 2015-11-24 13:19:45 UTC
Created attachment 1098194 [details]
Xen 4.4.x, Xen 4.3.x

Comment 4 Martin Prpič 2015-12-08 12:27:15 UTC
External References:

http://xenbits.xen.org/xsa/advisory-158.html

Comment 5 Martin Prpič 2015-12-08 12:42:27 UTC
Created xen tracking bugs for this issue:

Affects: fedora-all [bug 1289568]

Comment 6 Martin Prpič 2015-12-10 14:26:07 UTC
Just added to the upstream advisory:

UPDATES IN VERSION 4
====================

Mention that the original patches had two problems, supplying an
incremental patch.

Comment 7 Fedora Update System 2015-12-17 07:26:56 UTC
xen-4.5.2-5.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2015-12-20 00:23:08 UTC
xen-4.5.2-5.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Wade Mealing 2017-10-19 09:33:58 UTC
Statement:

This issue does not affect the Linux kernel packages as shipped with Red Hat Enterprise Linux 5, 6, and 7, Red Hat Enterprise MRG 2, and realtime kernels.

At the time of writing, XEN on Red Hat Enterprise Linux 5 did not support ARM guests. XEN was not available on versions Red Hat Enterprise Linux 6 and 7, Red Hat Enterprise MRG 2, and realtime kernels.