From 3a058a562d44cbd785f7ec9871255a70d8c2b1a1 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 28 Jan 2022 16:37:53 +0100 Subject: [PATCH] Fix crash with NVIDIA proprietary driver with Present Resolves: #2046330 --- ...sent-Check-for-NULL-to-prevent-crash.patch | 43 +++++++++++++++++++ xorg-x11-server.spec | 8 +++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 0001-present-Check-for-NULL-to-prevent-crash.patch diff --git a/0001-present-Check-for-NULL-to-prevent-crash.patch b/0001-present-Check-for-NULL-to-prevent-crash.patch new file mode 100644 index 0000000..894ad0e --- /dev/null +++ b/0001-present-Check-for-NULL-to-prevent-crash.patch @@ -0,0 +1,43 @@ +From 94b4a3d45451d29e9539ea234ce8b5e9ed58546c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= +Date: Thu, 13 Jan 2022 00:47:27 +0100 +Subject: [PATCH xserver] present: Check for NULL to prevent crash +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1275 +Signed-off-by: Błażej Szczygieł +Tested-by: Aaron Plattner +(cherry picked from commit 22d5818851967408bb7c903cb345b7ca8766094c) +--- + present/present_scmd.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/present/present_scmd.c b/present/present_scmd.c +index 3c68e690b..11391adbb 100644 +--- a/present/present_scmd.c ++++ b/present/present_scmd.c +@@ -168,6 +168,9 @@ present_scmd_get_crtc(present_screen_priv_ptr screen_priv, WindowPtr window) + if (!screen_priv->info) + return NULL; + ++ if (!screen_priv->info->get_crtc) ++ return NULL; ++ + return (*screen_priv->info->get_crtc)(window); + } + +@@ -206,6 +209,9 @@ present_flush(WindowPtr window) + if (!screen_priv->info) + return; + ++ if (!screen_priv->info->flush) ++ return; ++ + (*screen_priv->info->flush) (window); + } + +-- +2.34.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 55ba38d..14457cb 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -42,7 +42,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.11 -Release: 8%{?gitdate:.%{gitdate}}%{?dist} +Release: 9%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -109,6 +109,9 @@ Patch109: 0009-modesetting-Use-EGL_MESA_query_driver-to-select-DRI-.patch Patch110: 0010-modesetting-Fix-build-with-glamor-disabled.patch # Because we still use automake Patch111: 0011-modesetting-set-gbm-as-dependency-for-autotools.patch +# Xorg crashes with NVIDIA proprietary driver when uisng Present +# https://bugzilla.redhat.com/show_bug.cgi?id=2046330 +Patch112: 0001-present-Check-for-NULL-to-prevent-crash.patch # CVE-2021-4011 Patch10009: 0001-record-Fix-out-of-bounds-access-in-SwapCreateRegiste.patch @@ -529,6 +532,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Fri Jan 28 2022 Olivier Fourdan - 1.20.11-9 +- Fix crash with NVIDIA proprietary driver with Present (#2046330) + * Wed Jan 26 2022 Adam Jackson - 1.20.11-8 - Only disable the PCI-specific driver probe, since we do still want fallback to fbdev to work.