Bug 1218240

Summary: Bugs in downstream X server patches cause server crash when starting with Xinerama enabled
Product: [openSUSE] openSUSE Distribution Reporter: Daniel Dadap <ddadap>
Component: X.OrgAssignee: Stefan Dirsch <sndirsch>
Status: RESOLVED FIXED QA Contact: Gfx Bugs <gfx-bugs>
Severity: Normal    
Priority: P3 - Medium    
Version: Leap 15.5   
Target Milestone: ---   
Hardware: All   
OS: openSUSE Leap 15.5   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: A patch for the downstream patches in the xorg-x11-server

Description Daniel Dadap 2023-12-20 02:23:48 UTC
Created attachment 871465 [details]
A patch for the downstream patches in the xorg-x11-server

A number of downstream patches in the xorg-x11-server package call rrGetScrPriv() without first ensuring that rrPrivKey is registered. This causes the server to crash when Xinerama is enabled, as enabling Xinerama disables the RANDR extension.

#0  0x00007ffff6e53d2b in raise () from /lib64/libc.so.6
#1  0x00007ffff6e553e5 in abort () from /lib64/libc.so.6
#2  0x00007ffff6e4bc6a in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007ffff6e4bcf2 in __assert_fail () from /lib64/libc.so.6
#4  0x00005555555982b9 in dixGetPrivateAddr (key=<optimized out>, key=<optimized out>, privates=0x5555558a2310) at ../../../include/privates.h:122
#5  0x00005555555f4578 in dixGetPrivateAddr (key=<optimized out>, key=<optimized out>, privates=<optimized out>) at xf86Init.c:380
#6  dixLookupPrivate (key=<optimized out>, privates=<optimized out>) at ../../../include/privates.h:165
#7  xf86AutoConfigureProviderOutputsForMaster (pMasterScreen=0x5555558a1f40) at xf86Init.c:293
#8  xf86AutoConfigProviderOutputs (pcbl=<optimized out>, data=<optimized out>, call_data=<optimized out>) at xf86Init.c:442
#9  0x00005555555b92c4 in _CallCallbacks (pcbl=pcbl@entry=0x5555557b1790 <RootWindowInitialized>, call_data=call_data@entry=0x0) at dixutils.c:743
#10 0x00005555555b7eca in CallCallbacks (call_data=0x0, pcbl=0x5555557b1790 <RootWindowInitialized>) at ../include/callback.h:83
#11 dix_main (argc=1, argv=0x7fffffffeca8, envp=<optimized out>) at main.c:247
#12 0x00007ffff6e3e24d in __libc_start_main () from /lib64/libc.so.6
#13 0x00005555555a17ca in _start () at ../sysdeps/x86_64/start.S:120

The following assert fires immediately before the crash:

Xorg: ../../../include/privates.h:122: dixGetPrivateAddr: Assertion `key->initialized' failed.

Editing the patches to check dixPrivateKeyRegistered(rrPrivKey) before calling rrGetScrPriv() avoids the crash. Note that older X.org server versions (for example, 1.20.3 in Leap 15.4) contain a similar upstream bug that was fixed with the following commit:

https://gitlab.freedesktop.org/xorg/xserver/-/commit/cfc5e5040
Comment 2 Stefan Dirsch 2024-01-06 16:39:59 UTC
Thanks a lot for the report and patch! Now submitted and fixed for

Tumbleweed
sle15-sp6 (beta)
sle15-sp5
sle15-sp4 (patch needed some adjustments)
Comment 3 Stefan Dirsch 2024-01-06 16:41:39 UTC
Closing as fixed.

In xorg-x11-server package update check for

Sat Jan  6 [...] UTC 2024 - Stefan Dirsch <sndirsch@suse.com>

- n_xserver-optimus-autoconfig-hack.patch
  u_randr-Do-not-crash-if-slave-screen-does-not-have-pro.patch
  u_xfree86-activate-GPU-screens-on-autobind.patch
  * check dixPrivateKeyRegistered(rrPrivKey) before calling
    rrGetScrPriv() to avoid xserver crash when Xinerama is enabled
    (boo#1218240)
Comment 5 OBSbugzilla Bot 2024-01-06 17:35:01 UTC
This is an autogenerated message for OBS integration:
This bug (1218240) was mentioned in
https://build.opensuse.org/request/show/1137260 Factory / xorg-x11-server
Comment 10 Maintenance Automation 2024-01-17 12:36:46 UTC
SUSE-SU-2024:0111-1: An update that solves four vulnerabilities and has two security fixes can now be installed.

Category: security (important)
Bug References: 1218176, 1218240, 1218582, 1218583, 1218584, 1218585
CVE References: CVE-2023-6816, CVE-2024-0229, CVE-2024-21885, CVE-2024-21886
Sources used:
openSUSE Leap 15.4 (src): xorg-x11-server-1.20.3-150400.38.40.1
SUSE Linux Enterprise High Performance Computing ESPOS 15 SP4 (src): xorg-x11-server-1.20.3-150400.38.40.1
SUSE Linux Enterprise High Performance Computing LTSS 15 SP4 (src): xorg-x11-server-1.20.3-150400.38.40.1
SUSE Linux Enterprise Real Time 15 SP4 (src): xorg-x11-server-1.20.3-150400.38.40.1
SUSE Linux Enterprise Desktop 15 SP4 LTSS 15-SP4 (src): xorg-x11-server-1.20.3-150400.38.40.1
SUSE Linux Enterprise Server 15 SP4 LTSS 15-SP4 (src): xorg-x11-server-1.20.3-150400.38.40.1
SUSE Linux Enterprise Server for SAP Applications 15 SP4 (src): xorg-x11-server-1.20.3-150400.38.40.1
SUSE Manager Proxy 4.3 (src): xorg-x11-server-1.20.3-150400.38.40.1
SUSE Manager Retail Branch Server 4.3 (src): xorg-x11-server-1.20.3-150400.38.40.1
SUSE Manager Server 4.3 (src): xorg-x11-server-1.20.3-150400.38.40.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 11 Maintenance Automation 2024-01-17 12:36:52 UTC
SUSE-SU-2024:0109-1: An update that solves four vulnerabilities and has two security fixes can now be installed.

Category: security (important)
Bug References: 1218176, 1218240, 1218582, 1218583, 1218584, 1218585
CVE References: CVE-2023-6816, CVE-2024-0229, CVE-2024-21885, CVE-2024-21886
Sources used:
openSUSE Leap 15.5 (src): xorg-x11-server-21.1.4-150500.7.18.1
Basesystem Module 15-SP5 (src): xorg-x11-server-21.1.4-150500.7.18.1
Development Tools Module 15-SP5 (src): xorg-x11-server-21.1.4-150500.7.18.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.