From 73743723547dc1a53408732e5e80143e002cd99a Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 10 Feb 2022 09:06:02 +0100 Subject: [PATCH] Fix a regression with hybrid gfx and NVIDIA proprietary driver Resolves: #2052605 --- ...msSharePixmapBacking-Segfault-Regres.patch | 49 +++++++++++++++++++ xorg-x11-server.spec | 8 ++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 0001-modesetting-Fix-msSharePixmapBacking-Segfault-Regres.patch diff --git a/0001-modesetting-Fix-msSharePixmapBacking-Segfault-Regres.patch b/0001-modesetting-Fix-msSharePixmapBacking-Segfault-Regres.patch new file mode 100644 index 0000000..cad0f7f --- /dev/null +++ b/0001-modesetting-Fix-msSharePixmapBacking-Segfault-Regres.patch @@ -0,0 +1,49 @@ +From 88f0787f93f097a125a0aa156eb9a5628adfc2c2 Mon Sep 17 00:00:00 2001 +From: Alex Goins +Date: Thu, 12 Dec 2019 20:18:53 -0600 +Subject: [PATCH xserver] modesetting: Fix msSharePixmapBacking Segfault + Regression +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit cb1b1e184 modified msSharePixmapBacking() to derive modesettingPtr from +the 'screen' argument. Unfortunately, the name of the argument is misleading -- +the screen is the slave screen. If the master is modesetting, +and the slave is not modesetting, it will segfault. + +To fix the problem, this change derives modesettingPtr from +ppix->drawable.pScreen. This method is already used when calling +ms->glamor.shareable_fd_from_pixmap() later in the function. + +To avoid future issues, this change also renames the 'screen' argument to +'slave'. + +Signed-off-by: Alex Goins +Reviewed-by: Michel Dänzer +(cherry picked from commit 456dff1bf890459840718339279dcb84d36531eb) +--- + hw/xfree86/drivers/modesetting/driver.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c +index ce8bac9f5..0817fa470 100644 +--- a/hw/xfree86/drivers/modesetting/driver.c ++++ b/hw/xfree86/drivers/modesetting/driver.c +@@ -1454,10 +1454,11 @@ CreateScreenResources(ScreenPtr pScreen) + } + + static Bool +-msSharePixmapBacking(PixmapPtr ppix, ScreenPtr screen, void **handle) ++msSharePixmapBacking(PixmapPtr ppix, ScreenPtr slave, void **handle) + { + #ifdef GLAMOR_HAS_GBM +- modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen)); ++ modesettingPtr ms = ++ modesettingPTR(xf86ScreenToScrn(ppix->drawable.pScreen)); + int ret; + CARD16 stride; + CARD32 size; +-- +2.34.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 14457cb..c09a1e5 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: 9%{?gitdate:.%{gitdate}}%{?dist} +Release: 10%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -112,6 +112,9 @@ 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 +# Fix a regression with hybrid gfx and NVIDIA proprietary driver +# https://bugzilla.redhat.com/show_bug.cgi?id=2052605 +Patch113: 0001-modesetting-Fix-msSharePixmapBacking-Segfault-Regres.patch # CVE-2021-4011 Patch10009: 0001-record-Fix-out-of-bounds-access-in-SwapCreateRegiste.patch @@ -532,6 +535,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Feb 10 2022 Olivier Fourdan - 1.20.11-10 +- Fix a regression with hybrid gfx and NVIDIA proprietary driver (#2052605) + * Fri Jan 28 2022 Olivier Fourdan - 1.20.11-9 - Fix crash with NVIDIA proprietary driver with Present (#2046330)