From 11dce6cad700adf71cc0892921ef107c4f62ff77 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 29 2019 12:54:01 +0000 Subject: import xorg-x11-server-1.20.1-5.6.el7_6 --- diff --git a/SOURCES/0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch b/SOURCES/0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch new file mode 100644 index 0000000..30554b9 --- /dev/null +++ b/SOURCES/0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch @@ -0,0 +1,31 @@ +From e50c85f4ebf559a3bac4817b41074c43d4691779 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 26 Oct 2018 17:47:30 -0700 +Subject: [PATCH xserver] Fix segfault on probing a non-PCI platform device on + a system with PCI. + +Some Broadcom set-top-box boards have PCI busses, but the GPU is still +probed through DT. We would dereference a null busid here in that +case. + +Signed-off-by: Eric Anholt +--- + hw/xfree86/common/xf86platformBus.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index cef47da03d..dadbac6c8f 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -289,7 +289,7 @@ xf86platformProbe(void) + for (i = 0; i < xf86_num_platform_devices; i++) { + char *busid = xf86_platform_odev_attributes(i)->busid; + +- if (pci && (strncmp(busid, "pci:", 4) == 0)) { ++ if (pci && busid && (strncmp(busid, "pci:", 4) == 0)) { + platform_find_pci_info(&xf86_platform_devices[i], busid); + } + +-- +2.21.0 + diff --git a/SOURCES/0001-linux-Fix-platform-device-PCI-detection-for-complex-.patch b/SOURCES/0001-linux-Fix-platform-device-PCI-detection-for-complex-.patch new file mode 100644 index 0000000..9c0a311 --- /dev/null +++ b/SOURCES/0001-linux-Fix-platform-device-PCI-detection-for-complex-.patch @@ -0,0 +1,45 @@ +From b6e18eb57f3dd104704d0a5ec3d2f051645b9068 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Wed, 19 Jun 2019 14:23:56 -0400 +Subject: [PATCH xserver] linux: Fix platform device PCI detection for complex + bus topologies + +Suppose you're in a Hyper-V guest and are trying to use PCI passthrough. +The ID_PATH that udev will construct for that looks something like +"acpi-VMBUS:00-pci-b8c8:00:00.0", and obviously looking for "pci-" in +the first four characters of that is going to not work. + +Instead, strstr. I suppose it's possible you could have _multiple_ PCI +buses in the path, in which case you'd want strrstr, if that were a +thing. +--- + config/udev.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/config/udev.c b/config/udev.c +index 314acba6ce..6e11aa3b88 100644 +--- a/config/udev.c ++++ b/config/udev.c +@@ -474,7 +474,7 @@ config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path + config_odev_probe_proc_ptr probe_callback) + { + struct OdevAttributes *attribs = config_odev_allocate_attributes(); +- const char *value; ++ const char *value, *str; + + attribs->path = XNFstrdup(path); + attribs->syspath = XNFstrdup(syspath); +@@ -482,8 +482,8 @@ config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path + attribs->minor = minor; + + value = udev_device_get_property_value(udev_device, "ID_PATH"); +- if (value && !strncmp(value, "pci-", 4)) { +- attribs->busid = XNFstrdup(value); ++ if (value && (str = strstr(value, "pci-"))) { ++ attribs->busid = XNFstrdup(str); + attribs->busid[3] = ':'; + } + +-- +2.21.0 + diff --git a/SOURCES/0001-xfree86-Only-switch-to-original-VT-if-it-is-active.patch b/SOURCES/0001-xfree86-Only-switch-to-original-VT-if-it-is-active.patch new file mode 100644 index 0000000..1e0768b --- /dev/null +++ b/SOURCES/0001-xfree86-Only-switch-to-original-VT-if-it-is-active.patch @@ -0,0 +1,136 @@ +From ff91c696ff8f5f56da40e107cb5c321539758a81 Mon Sep 17 00:00:00 2001 +From: Michal Srb +Date: Tue, 16 Oct 2018 09:32:13 +0200 +Subject: [PATCH xserver] xfree86: Only switch to original VT if it is active. + +If the X server is terminated while its VT is not active, it should +not change the current VT. + +v2: Query current state in xf86CloseConsole using VT_GETSTATE instead of + keeping track in xf86VTEnter/xf86VTLeave/etc. +--- + hw/xfree86/os-support/linux/lnx_init.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c +index 039dc4a4d..358d89f0f 100644 +--- a/hw/xfree86/os-support/linux/lnx_init.c ++++ b/hw/xfree86/os-support/linux/lnx_init.c +@@ -272,101 +272,111 @@ xf86OpenConsole(void) + xf86SetConsoleHandler(drain_console, NULL); + } + + nTty = tty_attr; + nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP); + nTty.c_oflag = 0; + nTty.c_cflag = CREAD | CS8; + nTty.c_lflag = 0; + nTty.c_cc[VTIME] = 0; + nTty.c_cc[VMIN] = 1; + cfsetispeed(&nTty, 9600); + cfsetospeed(&nTty, 9600); + tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty); + } + } + else { /* serverGeneration != 1 */ + if (!xf86Info.ShareVTs && xf86Info.autoVTSwitch) { + /* now get the VT */ + if (!switch_to(xf86Info.vtno, "xf86OpenConsole")) + FatalError("xf86OpenConsole: Switching VT failed\n"); + } + } + } + + #pragma GCC diagnostic pop + + void + xf86CloseConsole(void) + { + struct vt_mode VT; ++ struct vt_stat vts; + int ret; + + if (xf86Info.ShareVTs) { + close(xf86Info.consoleFd); + return; + } + + /* + * unregister the drain_console handler + * - what to do if someone else changed it in the meantime? + */ + xf86SetConsoleHandler(NULL, NULL); + + /* Back to text mode ... */ + SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT)); + if (ret < 0) + xf86Msg(X_WARNING, "xf86CloseConsole: KDSETMODE failed: %s\n", + strerror(errno)); + + SYSCALL(ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode)); + tcsetattr(xf86Info.consoleFd, TCSANOW, &tty_attr); + + SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT)); + if (ret < 0) + xf86Msg(X_WARNING, "xf86CloseConsole: VT_GETMODE failed: %s\n", + strerror(errno)); + else { + /* set dflt vt handling */ + VT.mode = VT_AUTO; + SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT)); + if (ret < 0) + xf86Msg(X_WARNING, "xf86CloseConsole: VT_SETMODE failed: %s\n", + strerror(errno)); + } + + if (xf86Info.autoVTSwitch) { + /* +- * Perform a switch back to the active VT when we were started +- */ ++ * Perform a switch back to the active VT when we were started if our ++ * vt is active now. ++ */ + if (activeVT >= 0) { +- switch_to(activeVT, "xf86CloseConsole"); ++ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETSTATE, &vts)); ++ if (ret < 0) { ++ xf86Msg(X_WARNING, "xf86OpenConsole: VT_GETSTATE failed: %s\n", ++ strerror(errno)); ++ } else { ++ if (vts.v_active == xf86Info.vtno) { ++ switch_to(activeVT, "xf86CloseConsole"); ++ } ++ } + activeVT = -1; + } + } + close(xf86Info.consoleFd); /* make the vt-manager happy */ + } + + #define CHECK_FOR_REQUIRED_ARGUMENT() \ + if (((i + 1) >= argc) || (!argv[i + 1])) { \ + ErrorF("Required argument to %s not specified\n", argv[i]); \ + UseMsg(); \ + FatalError("Required argument to %s not specified\n", argv[i]); \ + } + + int + xf86ProcessArgument(int argc, char *argv[], int i) + { + /* + * Keep server from detaching from controlling tty. This is useful + * when debugging (so the server can receive keyboard signals. + */ + if (!strcmp(argv[i], "-keeptty")) { + KeepTty = TRUE; + return 1; + } + + if ((argv[i][0] == 'v') && (argv[i][1] == 't')) { + if (sscanf(argv[i], "vt%2d", &xf86Info.vtno) == 0) { + UseMsg(); + xf86Info.vtno = -1; + return 0; +-- +2.21.0 + diff --git a/SPECS/xorg-x11-server.spec b/SPECS/xorg-x11-server.spec index 7bd0674..e38c540 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.1 -Release: 5.3%{?gitdate:.%{gitdate}}%{?dist} +Release: 5.6%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -109,6 +109,13 @@ Patch9755: 0001-modesetting-Hide-atomic-behind-Option-Atomic-boolean.patch Patch9756: 0001-xfree86-LeaveVT-from-xf86CrtcCloseScreen.patch Patch9757: 0001-Disable-logfile-and-modulepath-when-running-with-ele.patch +# Bug 1680120 - upstream backport to fix user switching +Patch9900: 0001-xfree86-Only-switch-to-original-VT-if-it-is-active.patch +# Bug 1717309 - Startx will have segment fault with hyper-V environment +Patch9901: 0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch +# ... which also needs https://gitlab.freedesktop.org/xorg/xserver/merge_requests/217 +Patch9902: 0001-linux-Fix-platform-device-PCI-detection-for-complex-.patch + %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri %global sdkdir %{_includedir}/xorg @@ -590,6 +597,16 @@ rm -rf $RPM_BUILD_ROOT %{xserver_source_dir} %changelog +* Wed Jun 19 2019 Adam Jackson - 1.20.1-5.6 +- Fix platform device PCI detection for complex bus topologies + +* Mon Jun 17 2019 Adam Jackson - 1.20.1-5.5 +- Fix segfault in non-PCI platform detection + +* Wed Jun 12 2019 Ray Strode - 1.20.1-5.4 +- Stop VT switching when inactive server dies + Related: #1719361 + * Tue Feb 12 2019 Adam Jackson - 1.20.1-5.3 - Sync platform probe patch with upstream