Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FCD6C4363D for ; Tue, 22 Sep 2020 13:41:36 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 35C8E20936 for ; Tue, 22 Sep 2020 13:41:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xen.org header.i=@xen.org header.b="tsEwmKd1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35C8E20936 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kKiXt-0004Mi-4k; Tue, 22 Sep 2020 13:41:25 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kKiUl-0001gf-8q for xen-devel@lists.xen.org; Tue, 22 Sep 2020 13:38:11 +0000 X-Inumbo-ID: 6b92994e-52f4-4d9e-8f31-d6171dba0445 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6b92994e-52f4-4d9e-8f31-d6171dba0445; Tue, 22 Sep 2020 13:37:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Date:Message-Id:Subject:CC:From:To:MIME-Version: Content-Transfer-Encoding:Content-Type; bh=+isba2oHNxAWLTpZElUcuF2o8dNqyf/0jqJsIMihQxY=; b=tsEwmKd10jaIOU41xIXoOT+L2c M9WfC9LIqco/Hd+RGv5X7Y6OV9Q2dhyEoI7elXcNbW/Zpm8Xcrz+PGQtc630Hb8REhaP7QW0XRjGO S3x/bW7vJUwzAQnrcBJiMxpNmYbC1Hes0XPkwYtqKzOnrbDA5w0s26qlxgKCylLY4JpU=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kKiTs-0006pV-VN; Tue, 22 Sep 2020 13:37:16 +0000 Received: from iwj by xenbits.xenproject.org with local (Exim 4.92) (envelope-from ) id 1kKiTs-0002Kw-UN; Tue, 22 Sep 2020 13:37:16 +0000 Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8" Content-Transfer-Encoding: binary MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) To: xen-announce@lists.xen.org, xen-devel@lists.xen.org, xen-users@lists.xen.org, oss-security@lists.openwall.com From: Xen.org security team CC: Xen.org security team Subject: Xen Security Advisory 338 v4 (CVE-2020-25597) - once valid event channels may not turn invalid Message-Id: Date: Tue, 22 Sep 2020 13:37:16 +0000 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" --=separator Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Xen Security Advisory CVE-2020-25597 / XSA-338 version 4 once valid event channels may not turn invalid UPDATES IN VERSION 4 ==================== Public release. ISSUE DESCRIPTION ================= Logic in the handling of event channel operations in Xen assumes that an event channel, once valid, will not become invalid over the life time of a guest. However, operations like the resetting of all event channels may involve decreasing one of the bounds checked when determining validity. This may lead to bug checks triggering, crashing the host. IMPACT ====== An unprivileged guest may be able to crash Xen, leading to a Denial of Service (DoS) for the entire system. VULNERABLE SYSTEMS ================== All Xen versions from 4.4 onwards are vulnerable. Xen versions 4.3 and earlier are not vulnerable. Only systems with untrusted guests permitted to create more than the default number of event channels are vulnerable. This number depends on the architecture and type of guest. For 32-bit x86 PV guests, this is 1023; for 64-bit x86 PV guests, and for all ARM guests, this number is 4095. Systems where untrusted guests are limited to fewer than this number are not vulnerable. Note that xl and libxl limit max_event_channels to 1023 by default, so systems using exlusively xl, libvirt+libxl, or their own toolstack based on libxl, and not explicitly setting max_event_channels, are not vulnerable. MITIGATION ========== The problem can be avoided by reducing the number of event channels available to the guest to no more than 1023. For example, setting "max_event_channels=1023" in the xl domain configuration, or deleting any existing setting (since 1023 is the default for xl/libxl). For ARM systems, any limit no more than 4095 is safe. For 64-bit x86 PV guests, any limit no more than 4095 is likewise safe if the host configuration prevents the guest administrator from substituting and running a 32-bit kernel (and thereby putting the guest into 32-bit PV mode). CREDITS ======= This issue was discovered by Jan Beulich of SUSE. 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. xsa338.patch Xen 4.10 - xen-unstable $ sha256sum xsa338* 56c322b89a96db6be40cf15fdb9303e24ff692aa5a6274b2d7718bfc05acf309 xsa338.meta 7345eac1cbad23b082523e9cbd0331f8a9f16c6e459fb2a686606253f5514c9b xsa338.patch $ DEPLOYMENT DURING EMBARGO ========================= Deployment of the *patch* 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). And: deployment of the event channel limit reduction mitigation is NOT permitted (except where all the affected systems and VMs are administered and used only by organisations which are members of the Xen Project Security Issues Predisclosure List). Specifically, deployment on public cloud systems is NOT permitted. This is because such a change can be visible to the guest, so it would leak the preconditions for the vulnerability and maybe lead to rediscovery. Deployment of this, or similar mitigations, is permitted only AFTER the embargo ends. 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/4UyVfoK9kFAl9p/ecMHHBncEB4ZW4u b3JnAAoJEIP+FMlX6CvZlToIAMY5ZvKvqVmLzy/UEZrq3lgf8DA2+n9BFnec+XlI gDz7ssJNgwnkrrt7BF/XGeaAwly/pRACLapYd7hP8KNM3qPz/DG++S2FS/O44AkQ 7yjYRoEJRxFK1RnG3UeVw9S8aDrUrsTIoh7WFsX7rvEw6zg6o4kii4YSjvUSV5ug uYh0p3i56CWqjlKd94ZQlESfacrl1wZd/AemdDbAzj/FMF0ZyQujQ3PHBAcLjbPR jzE/EJRjpEPe9kMWKDWX06VlWja6cUDFIlaqZM9nlgiyI643y2iRSuilQbansMPA zG6SXQOqzSWc+OQ3wUaf972mjNfiKiBSFo/hB95HdS5I2Pk= =EzUa -----END PGP SIGNATURE----- --=separator Content-Type: application/octet-stream; name="xsa338.meta" Content-Disposition: attachment; filename="xsa338.meta" Content-Transfer-Encoding: base64 ewogICJYU0EiOiAzMzgsCiAgIlN1cHBvcnRlZFZlcnNpb25zIjogWwogICAg Im1hc3RlciIsCiAgICAiNC4xNCIsCiAgICAiNC4xMyIsCiAgICAiNC4xMiIs CiAgICAiNC4xMSIsCiAgICAiNC4xMCIKICBdLAogICJUcmVlcyI6IFsKICAg ICJ4ZW4iCiAgXSwKICAiUmVjaXBlcyI6IHsKICAgICI0LjEwIjogewogICAg ICAiUmVjaXBlcyI6IHsKICAgICAgICAieGVuIjogewogICAgICAgICAgIlN0 YWJsZVJlZiI6ICI5M2JlOTQzZTdkNzU5MDE1YmQ1ZGI0MWE0OGY2ZGNlNThl NTgwZDVhIiwKICAgICAgICAgICJQcmVyZXFzIjogWwogICAgICAgICAgICAz MzYsCiAgICAgICAgICAgIDMzNwogICAgICAgICAgXSwKICAgICAgICAgICJQ YXRjaGVzIjogWwogICAgICAgICAgICAieHNhMzM4LnBhdGNoIgogICAgICAg ICAgXQogICAgICAgIH0KICAgICAgfQogICAgfSwKICAgICI0LjExIjogewog ICAgICAiUmVjaXBlcyI6IHsKICAgICAgICAieGVuIjogewogICAgICAgICAg IlN0YWJsZVJlZiI6ICJkZGFhY2NiYmFiNmIxOWJmMjFlZDJjMDk3ZjMwNTVh M2MyNTQ0YzhkIiwKICAgICAgICAgICJQcmVyZXFzIjogWwogICAgICAgICAg ICAzMzMsCiAgICAgICAgICAgIDMzNiwKICAgICAgICAgICAgMzM3CiAgICAg ICAgICBdLAogICAgICAgICAgIlBhdGNoZXMiOiBbCiAgICAgICAgICAgICJ4 c2EzMzgucGF0Y2giCiAgICAgICAgICBdCiAgICAgICAgfQogICAgICB9CiAg ICB9LAogICAgIjQuMTIiOiB7CiAgICAgICJSZWNpcGVzIjogewogICAgICAg ICJ4ZW4iOiB7CiAgICAgICAgICAiU3RhYmxlUmVmIjogIjEzMzZjYTE3NzQy NDcxZmM0YTU5ODc5YWUyZjYzN2E1OTUzMGE5MzMiLAogICAgICAgICAgIlBy ZXJlcXMiOiBbCiAgICAgICAgICAgIDMzMywKICAgICAgICAgICAgMzM0LAog ICAgICAgICAgICAzMzYsCiAgICAgICAgICAgIDMzNwogICAgICAgICAgXSwK ICAgICAgICAgICJQYXRjaGVzIjogWwogICAgICAgICAgICAieHNhMzM4LnBh dGNoIgogICAgICAgICAgXQogICAgICAgIH0KICAgICAgfQogICAgfSwKICAg ICI0LjEzIjogewogICAgICAiUmVjaXBlcyI6IHsKICAgICAgICAieGVuIjog ewogICAgICAgICAgIlN0YWJsZVJlZiI6ICI5YjM2N2IyYjBiNzE0ZjNmZmI2 OWVkNmJlMGExMThlOGQzZWFjMDdmIiwKICAgICAgICAgICJQcmVyZXFzIjog WwogICAgICAgICAgICAzMzMsCiAgICAgICAgICAgIDMzNCwKICAgICAgICAg ICAgMzM2LAogICAgICAgICAgICAzMzcKICAgICAgICAgIF0sCiAgICAgICAg ICAiUGF0Y2hlcyI6IFsKICAgICAgICAgICAgInhzYTMzOC5wYXRjaCIKICAg ICAgICAgIF0KICAgICAgICB9CiAgICAgIH0KICAgIH0sCiAgICAiNC4xNCI6 IHsKICAgICAgIlJlY2lwZXMiOiB7CiAgICAgICAgInhlbiI6IHsKICAgICAg ICAgICJTdGFibGVSZWYiOiAiYzNhMGZjMjJhZjkwZWYyOGU2OGIxMTZjNmE0 OWQ5Y2VjNTdmNzFjZiIsCiAgICAgICAgICAiUHJlcmVxcyI6IFsKICAgICAg ICAgICAgMzMzLAogICAgICAgICAgICAzMzQsCiAgICAgICAgICAgIDMzNiwK ICAgICAgICAgICAgMzM3CiAgICAgICAgICBdLAogICAgICAgICAgIlBhdGNo ZXMiOiBbCiAgICAgICAgICAgICJ4c2EzMzgucGF0Y2giCiAgICAgICAgICBd CiAgICAgICAgfQogICAgICB9CiAgICB9LAogICAgIm1hc3RlciI6IHsKICAg ICAgIlJlY2lwZXMiOiB7CiAgICAgICAgInhlbiI6IHsKICAgICAgICAgICJT dGFibGVSZWYiOiAiYjExOTEwMDgyZDkwYmIxNTk3ZjY2Nzk1MjRlYjcyNmEz MzMwNjY3MiIsCiAgICAgICAgICAiUHJlcmVxcyI6IFsKICAgICAgICAgICAg MzMzLAogICAgICAgICAgICAzMzQsCiAgICAgICAgICAgIDMzNiwKICAgICAg ICAgICAgMzM3CiAgICAgICAgICBdLAogICAgICAgICAgIlBhdGNoZXMiOiBb CiAgICAgICAgICAgICJ4c2EzMzgucGF0Y2giCiAgICAgICAgICBdCiAgICAg ICAgfQogICAgICB9CiAgICB9CiAgfQp9 --=separator Content-Type: application/octet-stream; name="xsa338.patch" Content-Disposition: attachment; filename="xsa338.patch" Content-Transfer-Encoding: base64 RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0 OiBldnRjaG46IHJlbGF4IHBvcnRfaXNfdmFsaWQoKQoKVG8gYXZvaWQgcG9y dHMgcG90ZW50aWFsbHkgYmVjb21pbmcgaW52YWxpZCBiZWhpbmQgdGhlIGJh Y2sgb2YgY2VydGFpbgpvdGhlciBmdW5jdGlvbnMgKGR1ZSB0byAtPm1heF9l dnRjaG4gc2hyaW5raW5nKSBiZWNhdXNlIG9mCi0gYSBndWVzdCBpbnZva2lu ZyBldnRjaG5fcmVzZXQoKSBhbmQgZnJvbSBhIDJuZCB2Q1BVIG9wZW5pbmcg bmV3CiAgY2hhbm5lbHMgaW4gcGFyYWxsZWwgKHNlZSBhbHNvIFhTQS0zNDMp LAotIGFsbG9jX3VuYm91bmRfeGVuX2V2ZW50X2NoYW5uZWwoKSBwcm9kdWNl ZCBjaGFubmVscyBsaXZpbmcgYWJvdmUgdGhlCiAgMi1sZXZlbCByYW5nZSAo c2VlIGFsc28gWFNBLTM0MiksCmRyb3AgdGhlIG1heF9ldnRjaG5zIGNoZWNr IGZyb20gcG9ydF9pc192YWxpZCgpLiBGb3IgYSBwb3J0IGZvciB3aGljaAp0 aGUgZnVuY3Rpb24gb25jZSByZXR1cm5lZCAidHJ1ZSIsIHRoZSByZXR1cm5l ZCB2YWx1ZSBtYXkgbm90IHR1cm4gaW50bwoiZmFsc2UiIGxhdGVyIG9uLiBU aGUgZnVuY3Rpb24ncyByZXN1bHQgbWF5IG9ubHkgZGVwZW5kIG9uIGJvdW5k cyB3aGljaApjYW4gb25seSBldmVyIGdyb3cgKHdoaW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