From f6217be6e11f710539e1783bd31c3f2556b5bd71 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 1 Mar 2022 05:58:24 -0500 Subject: [PATCH] import xorg-x11-server-1.20.11-10.el9 --- ...msSharePixmapBacking-Segfault-Regres.patch | 49 +++++++++++ ...d-xfree86-Disable-the-PCI-probe-path.patch | 83 +++++++++++++++++++ ...Only-call-the-driver-s-platformProbe.patch | 43 ---------- ...sent-Check-for-NULL-to-prevent-crash.patch | 43 ++++++++++ SPECS/xorg-x11-server.spec | 23 ++++- 5 files changed, 195 insertions(+), 46 deletions(-) create mode 100644 SOURCES/0001-modesetting-Fix-msSharePixmapBacking-Segfault-Regres.patch create mode 100644 SOURCES/0001-mustard-xfree86-Disable-the-PCI-probe-path.patch delete mode 100644 SOURCES/0001-mustard-xfree86-Only-call-the-driver-s-platformProbe.patch create mode 100644 SOURCES/0001-present-Check-for-NULL-to-prevent-crash.patch diff --git a/SOURCES/0001-modesetting-Fix-msSharePixmapBacking-Segfault-Regres.patch b/SOURCES/0001-modesetting-Fix-msSharePixmapBacking-Segfault-Regres.patch new file mode 100644 index 0000000..cad0f7f --- /dev/null +++ b/SOURCES/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/SOURCES/0001-mustard-xfree86-Disable-the-PCI-probe-path.patch b/SOURCES/0001-mustard-xfree86-Disable-the-PCI-probe-path.patch new file mode 100644 index 0000000..0528cc6 --- /dev/null +++ b/SOURCES/0001-mustard-xfree86-Disable-the-PCI-probe-path.patch @@ -0,0 +1,83 @@ +From b3afd9ccefe156ab2dee993118fcdba40341f66e Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Fri, 1 Oct 2021 11:47:21 -0400 +Subject: [PATCH xserver] mustard: xfree86: Disable the PCI probe path + +RHEL 9 does not support userspace modesetting drivers for Xorg. Ideally +it would only support DRM drivers, but there are some fallback paths +(efifb mainly) that still require fbdev support. Since the primary use +of the PCI probe path is devices _without_ kernel support, we can safely +disable it. And indeed we want to, because there are some devices +(hyperv v1 e.g.) with both a platform and a PCI presentation, which the +PCI probe code fails to handle such that the server fails to start. + +Thus: we #if 0 out the PCI probe in xf86CallDriverProbe. + +It might be nice if the platform code knew about fbdev devices, but it +does not, and teaching it would be a large change for little benefit +given we do intend to sunset the fbdev path as well. Since the fbdev +path exists solely for cases where we have only the rudimentary firmare +framebuffer, we should only use it if _no_ platform driver is available. + +Thus: we only call the legacy probe method if xf86ProbeIgnorePrimary. + +Having done this, we need to go back into fbdevhw and undo fc78bcca: + + commit fc78bcca21e767697de6ad4d8e03b6728856f613 (merge-requests/38) + Author: Adam Jackson + Date: Wed Oct 10 14:09:11 2018 -0400 + + fbdevhw: Refuse to touch PCI devices on the fallback probe path + +Which was well intentioned, but given the above changes we know by the +time we're trying to probe fbdev we really do want it, either because of +the above fallback path or because xorg.conf asked for it. In either +case we shouldn't spuriously fail just because it happens to be PCI. + +Thus: We if (0) out the code added in fc78bcca. + +Any one of the above might be questionable upstream, hence the mustard +nature of this patch. +--- + hw/xfree86/common/xf86Bus.c | 4 ++-- + hw/xfree86/fbdevhw/fbdevhw.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c +index fd144dbe7a..844ce5a890 100644 +--- a/hw/xfree86/common/xf86Bus.c ++++ b/hw/xfree86/common/xf86Bus.c +@@ -84,7 +84,7 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only) + } + #endif + +-#ifdef XSERVER_LIBPCIACCESS ++#if 0 + if (!foundScreen && (drv->PciProbe != NULL)) { + if (xf86DoConfigure && xf86DoConfigurePass1) { + assert(detect_only); +@@ -96,7 +96,7 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only) + } + } + #endif +- if (!foundScreen && (drv->Probe != NULL)) { ++ if (!foundScreen && xf86ProbeIgnorePrimary && (drv->Probe != NULL)) { + xf86Msg(X_WARNING, "Falling back to old probe method for %s\n", + drv->driverName); + foundScreen = (*drv->Probe) (drv, (detect_only) ? PROBE_DETECT +diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c +index 3d8b92e669..171038f46d 100644 +--- a/hw/xfree86/fbdevhw/fbdevhw.c ++++ b/hw/xfree86/fbdevhw/fbdevhw.c +@@ -330,7 +330,7 @@ fbdev_open(int scrnIndex, const char *dev, char **namep) + } + + /* only touch non-PCI devices on this path */ +- { ++ if (0) { + char buf[PATH_MAX]; + char *sysfs_path = NULL; + char *node = strrchr(dev, '/') + 1; +-- +2.31.1 + diff --git a/SOURCES/0001-mustard-xfree86-Only-call-the-driver-s-platformProbe.patch b/SOURCES/0001-mustard-xfree86-Only-call-the-driver-s-platformProbe.patch deleted file mode 100644 index ae0c0b9..0000000 --- a/SOURCES/0001-mustard-xfree86-Only-call-the-driver-s-platformProbe.patch +++ /dev/null @@ -1,43 +0,0 @@ -From ab756b13392448201c106b7629c55f68af4d8ec5 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Fri, 1 Oct 2021 11:47:21 -0400 -Subject: [PATCH xserver] mustard: xfree86: Only call the driver's - platformProbe - -The code to detangle what's a PCI device and what's platform is... bad. -The PCI-specific initialization path should never be necessary these -days, and the ancient "just probe something" path should especially -never be necessary, so we can avoid a bunch of fragile code by simply -never calling into the non-platform probe paths and letting platform -handle everything. - -Among other things this fixes hypervdrm on v1 devices, which have both a -PCI and a platform presentation, in a way that would cause X to fail to -start. ---- - hw/xfree86/common/xf86Bus.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c -index fd144dbe7a..88e07dec40 100644 ---- a/hw/xfree86/common/xf86Bus.c -+++ b/hw/xfree86/common/xf86Bus.c -@@ -84,6 +84,7 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only) - } - #endif - -+#if 0 - #ifdef XSERVER_LIBPCIACCESS - if (!foundScreen && (drv->PciProbe != NULL)) { - if (xf86DoConfigure && xf86DoConfigurePass1) { -@@ -102,6 +103,7 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only) - foundScreen = (*drv->Probe) (drv, (detect_only) ? PROBE_DETECT - : PROBE_DEFAULT); - } -+#endif - - return foundScreen; - } --- -2.31.1 - diff --git a/SOURCES/0001-present-Check-for-NULL-to-prevent-crash.patch b/SOURCES/0001-present-Check-for-NULL-to-prevent-crash.patch new file mode 100644 index 0000000..894ad0e --- /dev/null +++ b/SOURCES/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/SPECS/xorg-x11-server.spec b/SPECS/xorg-x11-server.spec index 6e56348..c09a1e5 100644 --- a/SPECS/xorg-x11-server.spec +++ b/SPECS/xorg-x11-server.spec @@ -42,7 +42,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.11 -Release: 7%{?gitdate:.%{gitdate}}%{?dist} +Release: 10%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -92,8 +92,8 @@ Patch6: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch Patch7: 0001-xkb-Drop-check-for-XkbSetMapResizeTypes.patch # 1988922 - [Hyper-V]Installation failed with: 'x or window manager startup failed' when the VM was created with GEN1 - -Patch8: 0001-mustard-xfree86-Only-call-the-driver-s-platformProbe.patch +# 2029769 - fbdev Xorg driver no longer works as a fallback with unsupported hardware +Patch8: 0001-mustard-xfree86-Disable-the-PCI-probe-path.patch # Backports from current stable "server-1.20-branch": # @@ -109,6 +109,12 @@ 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 +# 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 @@ -529,6 +535,17 @@ 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) + +* 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. + Resolves: #2029769 + * Thu Jan 6 2022 Olivier Fourdan - 1.20.11-7 - CVE fix for: CVE-2021-4008 (#2030160), CVE-2021-4009 (#2030170), CVE-2021-4010 (#2030174), CVE-2021-4011 (#2030179)