From patchwork Sat Apr 24 21:36:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Famulari X-Patchwork-Id: 28859 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1322A27BC7D; Sat, 24 Apr 2021 22:37:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6DBFF27BC7C for ; Sat, 24 Apr 2021 22:37:09 +0100 (BST) Received: from localhost ([::1]:52828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1laPxc-0000Nl-Ml for patchwork@mira.cbaines.net; Sat, 24 Apr 2021 17:37:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laPxW-0000Nc-O4 for guix-patches@gnu.org; Sat, 24 Apr 2021 17:37:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58309) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1laPxW-00078J-Gm for guix-patches@gnu.org; Sat, 24 Apr 2021 17:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1laPxW-0000Fj-EH for guix-patches@gnu.org; Sat, 24 Apr 2021 17:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48001] [PATCH] gnu: xorg-server: CVE-2021-3472. References: In-Reply-To: Resent-From: Leo Famulari Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 24 Apr 2021 21:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48001 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48001@debbugs.gnu.org Received: via spool by 48001-submit@debbugs.gnu.org id=B48001.1619300213956 (code B ref 48001); Sat, 24 Apr 2021 21:37:02 +0000 Received: (at 48001) by debbugs.gnu.org; 24 Apr 2021 21:36:53 +0000 Received: from localhost ([127.0.0.1]:41622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1laPxF-0000FD-IN for submit@debbugs.gnu.org; Sat, 24 Apr 2021 17:36:53 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:38261) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1laPxC-0000Ew-3e for 48001@debbugs.gnu.org; Sat, 24 Apr 2021 17:36:44 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 05E535C008C; Sat, 24 Apr 2021 17:36:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 24 Apr 2021 17:36:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=date:from:to:subject:message-id:mime-version:content-type; s= mesmtp; bh=XWOYuSkWOfXe41tk4j82ROePxvSi2SBw1DY4Ouvl7EE=; b=Hmz7S CZA8+1WhW5sJDBtlq/j6EqFQ//HJmw1ady+5EHT9MQzfmIgxEB8nTfd4T65AqRn9 l83a7uHtxp2ZTBXSaH438pWn7FxLoVr/PpRSDEsrXv4BZt70+n6/YGLBqAZ9Psgl TVccJdZPPMtoKNfAy7YgV/53cwXLfXnWgZCHeQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=XWOYuSkWOfXe41tk4j82ROePxvSi2 SBw1DY4Ouvl7EE=; b=YEHrQXhDaQ3DhX5vnI06Q4iuGD8wJq5tk/FcsEJUZoj4W dwoVwfUv2+boGq664GRL3HdLaCV9TQDTE0QE8lDBGDggijm8fZMK2q09aWztQKhH n5SznX4xUvZwEH0YEp0nuiX0ZmgcRvXTROSRsqkSXfG7b2FL+of5C0783e7RKVDp EkfXYP3XoXZQj00WG7WFS3bretD+mqNKNvnnsfrTPJdZuZh3qepa5HfIL3xV4PjL ZhqrfVE+O3iVYrFvcF+h6d56rizL9cPT2NeDYaw9elPlDm/YBWaLv44arIKt4luZ io+iaqIIe6UtKmsDo8OWDmexhB+609070myPN3cDg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddugedgudeigecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggusehgtdorre dttddvnecuhfhrohhmpefnvghoucfhrghmuhhlrghrihcuoehlvghosehfrghmuhhlrghr ihdrnhgrmhgvqeenucggtffrrghtthgvrhhnpeejkeejgfdtffegvddthfehjeelvdelhf euieetvedvjeffleegvdefffdvveegkeenucfkphepuddttddruddurdduieelrdduudek necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgvoh esfhgrmhhulhgrrhhirdhnrghmvg X-ME-Proxy: Received: from localhost (pool-100-11-169-118.phlapa.fios.verizon.net [100.11.169.118]) by mail.messagingengine.com (Postfix) with ESMTPA id 82CEC240054 for <48001@debbugs.gnu.org>; Sat, 24 Apr 2021 17:36:35 -0400 (EDT) Date: Sat, 24 Apr 2021 17:36:30 -0400 From: Leo Famulari Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches The first revision of this patch does not take care to avoid changing the derivation of xorg-server-for-tests, so it would cause way too many packages to be rebuilt. Here is a revised patch that ensures the derivation remains the same. For example: ------ $ guix build -e '(@@ (gnu packages xorg) xorg-server-for-tests)' --no-grafts -d /gnu/store/nhs1c9q04g6k4prxxv4kb9q5lg1p872q-xorg-server-1.20.10.drv $ ./pre-inst-env guix build -e '(@@ (gnu packages xorg) xorg-server-for-tests)' --no-grafts -d /gnu/store/nhs1c9q04g6k4prxxv4kb9q5lg1p872q-xorg-server-1.20.10.drv ------ From cc4b92215511eb4cd0853438194004159964cbd4 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sat, 24 Apr 2021 15:34:24 -0400 Subject: [PATCH] gnu: xorg-server: CVE-2021-3472. * gnu/packages/patches/xorg-server-CVE-2021-3472.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/xorg.scm (xorg-server)[source]: Use it. [xorg-server-for-tests]: Do not use it, to avoid changing the derivation of this package. --- gnu/local.mk | 1 + .../patches/xorg-server-CVE-2021-3472.patch | 44 +++++++++++++++++++ gnu/packages/xorg.scm | 31 +++++++++++-- 3 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/xorg-server-CVE-2021-3472.patch diff --git a/gnu/local.mk b/gnu/local.mk index 50b11a8ca2..3d076de924 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1815,6 +1815,7 @@ dist_patch_DATA = \ %D%/packages/patches/xfce4-panel-plugins.patch \ %D%/packages/patches/xfce4-settings-defaults.patch \ %D%/packages/patches/xmonad-dynamic-linking.patch \ + %D%/packages/patches/xorg-server-CVE-2021-3472.patch \ %D%/packages/patches/xplanet-1.3.1-cxx11-eof.patch \ %D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \ %D%/packages/patches/xplanet-1.3.1-libimage_gif.c.patch \ diff --git a/gnu/packages/patches/xorg-server-CVE-2021-3472.patch b/gnu/packages/patches/xorg-server-CVE-2021-3472.patch new file mode 100644 index 0000000000..523a5b1dbf --- /dev/null +++ b/gnu/packages/patches/xorg-server-CVE-2021-3472.patch @@ -0,0 +1,44 @@ +Fix CVE-2021-3472: + +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3472 +https://seclists.org/oss-sec/2021/q2/20 + +Patch copied from upstream source repository: + +https://gitlab.freedesktop.org/xorg/xserver/-/commit/7aaf54a1884f71dc363f0b884e57bcb67407a6cd + +From 7aaf54a1884f71dc363f0b884e57bcb67407a6cd Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb +Date: Sun, 21 Mar 2021 18:38:57 +0100 +Subject: [PATCH] Fix XChangeFeedbackControl() request underflow + +CVE-2021-3472 / ZDI-CAN-1259 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Matthieu Herrb +--- + Xi/chgfctl.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c +index 1de4da9ef..7a597e43d 100644 +--- a/Xi/chgfctl.c ++++ b/Xi/chgfctl.c +@@ -464,8 +464,11 @@ ProcXChangeFeedbackControl(ClientPtr client) + break; + case StringFeedbackClass: + { +- xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]); ++ xStringFeedbackCtl *f; + ++ REQUEST_AT_LEAST_EXTRA_SIZE(xChangeFeedbackControlReq, ++ sizeof(xStringFeedbackCtl)); ++ f = ((xStringFeedbackCtl *) &stuff[1]); + if (client->swapped) { + if (len < bytes_to_int32(sizeof(xStringFeedbackCtl))) + return BadLength; +-- +2.31.1 + diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index 97ff8ab92b..941958aa7a 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -5312,7 +5312,7 @@ over Xlib, including: (base32 "16bwrf0ag41l7jbrllbix8z6avc5yimga7ihvq4ch3a5hb020x4p")) (patches - (list + (cons ;; See: ;; https://lists.fedoraproject.org/archives/list/devel@lists. ;; fedoraproject.org/message/JU655YB7AM4OOEQ4MOMCRHJTYJ76VFOK/ @@ -5324,7 +5324,8 @@ over Xlib, including: (sha256 (base32 "0mm70y058r8s9y9jiv7q2myv0ycnaw3iqzm7d274410s0ik38w7q")) - (file-name "xorg-server-use-intel-only-on-pre-gen4.diff")))))) + (file-name "xorg-server-use-intel-only-on-pre-gen4.diff")) + (search-patches "xorg-server-CVE-2021-3472.patch"))))) (build-system gnu-build-system) (propagated-inputs `(("libpciaccess" ,libpciaccess) @@ -5432,7 +5433,31 @@ draggable titlebars and borders.") (define-public xorg-server-for-tests (hidden-package (package - (inherit xorg-server)))) + (inherit xorg-server) + (version "1.20.10") + ;; Don't apply xorg-server-CVE-2021-3472.patch + (source + (origin + (method url-fetch) + (uri (string-append "mirror://xorg/individual/xserver/" + "xorg-server-" version ".tar.bz2")) + (sha256 + (base32 + "16bwrf0ag41l7jbrllbix8z6avc5yimga7ihvq4ch3a5hb020x4p")) + (patches + (list + ;; See: + ;; https://lists.fedoraproject.org/archives/list/devel@lists. + ;; fedoraproject.org/message/JU655YB7AM4OOEQ4MOMCRHJTYJ76VFOK/ + (origin + (method url-fetch) + (uri (string-append + "http://pkgs.fedoraproject.org/cgit/rpms/xorg-x11-server.git" + "/plain/06_use-intel-only-on-pre-gen4.diff")) + (sha256 + (base32 + "0mm70y058r8s9y9jiv7q2myv0ycnaw3iqzm7d274410s0ik38w7q")) + (file-name "xorg-server-use-intel-only-on-pre-gen4.diff"))))))))) (define-public xorg-server-xwayland (package/inherit xorg-server