diff -Nru xorg-server-21.1.11/ChangeLog xorg-server-21.1.12/ChangeLog --- xorg-server-21.1.11/ChangeLog 2024-01-16 09:59:38.000000000 +0000 +++ xorg-server-21.1.12/ChangeLog 2024-04-03 20:50:54.000000000 +0000 @@ -1,3 +1,217 @@ +commit 101caa1b03bc26b718f4618eb24104add5d14a4b +Author: Povilas Kanapickas +Date: Wed Apr 3 23:43:42 2024 +0300 + + xserver 21.1.12 + + Signed-off-by: Povilas Kanapickas + +commit 1173156404be826f50f453ca11bda28ccb5a5268 +Author: Peter Hutterer +Date: Tue Jan 30 13:13:35 2024 +1000 + + render: fix refcounting of glyphs during ProcRenderAddGlyphs + + Previously, AllocateGlyph would return a new glyph with refcount=0 and a + re-used glyph would end up not changing the refcount at all. The + resulting glyph_new array would thus have multiple entries pointing to + the same non-refcounted glyphs. + + AddGlyph may free a glyph, resulting in a UAF when the same glyph + pointer is then later used. + + Fix this by returning a refcount of 1 for a new glyph and always + incrementing the refcount for a re-used glyph, followed by dropping that + refcount back down again when we're done with it. + + CVE-2024-31083, ZDI-CAN-22880 + + This vulnerability was discovered by: + Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + + Part-of: + (cherry picked from commit bdca6c3d1f5057eeb31609b1280fc93237b00c77) + +commit 0e34d8ebc98a0ba6f9f0a2f8f5045761bccc45d3 +Author: Alan Coopersmith +Date: Fri Mar 22 19:07:34 2024 -0700 + + Xquartz: ProcAppleDRICreatePixmap needs to use unswapped length to send reply + + CVE-2024-31082 + + Fixes: 14205ade0 ("XQuartz: appledri: Fix byte swapping in replies") + Signed-off-by: Alan Coopersmith + Part-of: + (cherry picked from commit 6c684d035c06fd41c727f0ef0744517580864cef) + +commit cea92ca78f900bfb4c9a5540dfd631e065b9151b +Author: Alan Coopersmith +Date: Fri Mar 22 18:56:27 2024 -0700 + + Xi: ProcXIPassiveGrabDevice needs to use unswapped length to send reply + + CVE-2024-31081 + + Fixes: d220d6907 ("Xi: add GrabButton and GrabKeysym code.") + Signed-off-by: Alan Coopersmith + Part-of: + (cherry picked from commit 3e77295f888c67fc7645db5d0c00926a29ffecee) + +commit 8a7cd0e3ef194610300c1a38fb5a5423b23dd6a5 +Author: Alan Coopersmith +Date: Fri Mar 22 18:51:45 2024 -0700 + + Xi: ProcXIGetSelectedEvents needs to use unswapped length to send reply + + CVE-2024-31080 + + Reported-by: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69762 + Fixes: 53e821ab4 ("Xi: add request processing for XIGetSelectedEvents.") + Signed-off-by: Alan Coopersmith + Part-of: + (cherry picked from commit 96798fc1967491c80a4d0c8d9e0a80586cb2152b) + +commit 5ca3a95135d9c89753e2af19da5a2615ea2be1c3 +Author: Alan Coopersmith +Date: Thu Mar 21 18:08:35 2024 -0700 + + Xext: SProcSyncCreateFence needs to swap drawable id too + + Otherwise it causes the server to return BadDrawable giving a + byte-swapped resource id instead of the real id the client sent. + + Reported-by: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69762 + Fixes: 397dfd9f8 ("Create/Destroy/Trigger/Reset/Query Fence Sync objs") + Signed-off-by: Alan Coopersmith + --- + (cherry picked from commit e6573baa7d99a77f44229b9a96a41bbda57e2387) + + Part-of: + +commit 5d7272f05d9ef6bef93419febee3c9dfc63ec055 +Author: Peter Hutterer +Date: Sat Mar 23 10:42:33 2024 -0700 + + Allow disabling byte-swapped clients + + The X server swapping code is a huge attack surface, much of this code + is untested and prone to security issues. The use-case of byte-swapped + clients is very niche, so allow users to disable this if they don't + need it, using either a config option or commandline flag. + + For Xorg, this adds the ServerFlag "AllowByteSwappedClients" "off". + For all DDX, this adds the commandline options +byteswappedclients and + -byteswappedclients to enable or disable, respectively. + + Fixes #1201 + Signed-off-by: Peter Hutterer + --- + (cherry picked from commit 412777664a20dd3561b936c02c96571a756fe9b2) + (cherry picked from commit af5cd5acc9012e527ee869f8e98bf6c2e9a02ca4) + Backport to server-21.1-branch modified to keep byte-swapping enabled + by default but easy to disable by users or admins (or even by distros + shipping an xorg.conf.d fragment in their packages). + + Signed-off-by: Alan Coopersmith + Part-of: + +commit 8a46a463f631ed52613d67f4088924acbbb6ca20 +Author: Matthieu Herrb +Date: Sun Dec 5 22:05:08 2021 +0100 + + Initialize Mode->name in xf86CVTMode() + + This was overlooked when converting the function to use libxcvt. + Bring back name initialization from old code. + + This was causing a segfault in xf86LookupMode() if modes where + name is NULL are present the modePool list. + + Signed-off-by: Matthieu Herrb + --- + (cherry picked from ed11c4d443ad2e82512df64358d38008e0ee7693) + + Reported-by: "Sergiy" + Part-of: + +commit f653d9a0af912e577fab5c02b2a4eb380d33e8bb +Author: Yusuf Khan +Date: Sat Feb 17 12:38:10 2024 -0800 + + hw/xfree86: fix NULL pointer refrence to mode name + + Potentially, the pointer to the mode name could be unset, this can + occur with the xf86-video-nv DDX, in that case there isnt much we can do + except check if the next mode is any better. + + Signed-off-by: Yusuf Khan + --- + (cherry picked from db3aa4e03b180244e8b4b02272c49f1e0c48b463) + + Part-of: + +commit 8b75ec34dfbe435cd3a17e64138e22a37395a6d8 +Author: Povilas Kanapickas +Date: Sun Dec 19 18:11:07 2021 +0200 + + dix: Fix use after free in input device shutdown + + This fixes access to freed heap memory via dev->master. E.g. when + running BarrierNotify.ReceivesNotifyEvents/7 test from + xorg-integration-tests: + + ==24736==ERROR: AddressSanitizer: heap-use-after-free on address + 0x619000065020 at pc 0x55c450e2b9cf bp 0x7fffc532fd20 sp 0x7fffc532fd10 + READ of size 4 at 0x619000065020 thread T0 + #0 0x55c450e2b9ce in GetMaster ../../../dix/devices.c:2722 + #1 0x55c450e9d035 in IsFloating ../../../dix/events.c:346 + #2 0x55c4513209c6 in GetDeviceUse ../../../Xi/xiquerydevice.c:525 + ../../../Xi/xichangehierarchy.c:95 + #4 0x55c450e3455c in RemoveDevice ../../../dix/devices.c:1204 + ../../../hw/xfree86/common/xf86Xinput.c:1142 + #6 0x55c450e17b04 in CloseDeviceList ../../../dix/devices.c:1038 + #7 0x55c450e1de85 in CloseDownDevices ../../../dix/devices.c:1068 + #8 0x55c450e837ef in dix_main ../../../dix/main.c:302 + #9 0x55c4517a8d93 in main ../../../dix/stubmain.c:34 + (/lib/x86_64-linux-gnu/libc.so.6+0x28564) + #11 0x55c450d0113d in _start (/usr/lib/xorg/Xorg+0x117713d) + + 0x619000065020 is located 160 bytes inside of 912-byte region + [0x619000064f80,0x619000065310) + freed by thread T0 here: + (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf) + #1 0x55c450e19f1c in CloseDevice ../../../dix/devices.c:1014 + #2 0x55c450e343a4 in RemoveDevice ../../../dix/devices.c:1186 + ../../../hw/xfree86/common/xf86Xinput.c:1142 + #4 0x55c450e17b04 in CloseDeviceList ../../../dix/devices.c:1038 + #5 0x55c450e1de85 in CloseDownDevices ../../../dix/devices.c:1068 + #6 0x55c450e837ef in dix_main ../../../dix/main.c:302 + #7 0x55c4517a8d93 in main ../../../dix/stubmain.c:34 + (/lib/x86_64-linux-gnu/libc.so.6+0x28564) + + previously allocated by thread T0 here: + (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6) + #1 0x55c450e1c57b in AddInputDevice ../../../dix/devices.c:259 + #2 0x55c450e34840 in AllocDevicePair ../../../dix/devices.c:2755 + #3 0x55c45130318f in add_master ../../../Xi/xichangehierarchy.c:152 + ../../../Xi/xichangehierarchy.c:465 + #5 0x55c4512cb9f5 in ProcIDispatch ../../../Xi/extinit.c:390 + #6 0x55c450e6a92b in Dispatch ../../../dix/dispatch.c:551 + #7 0x55c450e834b7 in dix_main ../../../dix/main.c:272 + #8 0x55c4517a8d93 in main ../../../dix/stubmain.c:34 + (/lib/x86_64-linux-gnu/libc.so.6+0x28564) + + The problem is caused by dev->master being not reset when disabling the + device, which then causes dangling pointer when the master device itself + is being deleted when exiting whole server. + + Note that RecalculateMasterButtons() requires dev->master to be still + valid, so we can reset it only at the end of function. + + Signed-off-by: Povilas Kanapickas + (cherry picked from commit 1801fe0ac3926882d47d7e1ad6c0518a2cdffd41) + commit 31407c0199da877b359b2e37bb371804321279b7 Author: José Expósito Date: Tue Jan 16 10:15:15 2024 +0100 diff -Nru xorg-server-21.1.11/Xext/sync.c xorg-server-21.1.12/Xext/sync.c --- xorg-server-21.1.11/Xext/sync.c 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/Xext/sync.c 2024-04-03 20:50:12.000000000 +0000 @@ -2318,6 +2318,7 @@ REQUEST(xSyncCreateFenceReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xSyncCreateFenceReq); + swapl(&stuff->d); swapl(&stuff->fid); return ProcSyncCreateFence(client); diff -Nru xorg-server-21.1.11/Xi/xipassivegrab.c xorg-server-21.1.12/Xi/xipassivegrab.c --- xorg-server-21.1.11/Xi/xipassivegrab.c 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/Xi/xipassivegrab.c 2024-04-03 20:50:12.000000000 +0000 @@ -93,6 +93,7 @@ GrabParameters param; void *tmp; int mask_len; + uint32_t length; REQUEST(xXIPassiveGrabDeviceReq); REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq, @@ -247,9 +248,11 @@ } } + /* save the value before SRepXIPassiveGrabDevice swaps it */ + length = rep.length; WriteReplyToClient(client, sizeof(rep), &rep); if (rep.num_modifiers) - WriteToClient(client, rep.length * 4, modifiers_failed); + WriteToClient(client, length * 4, modifiers_failed); out: free(modifiers_failed); diff -Nru xorg-server-21.1.11/Xi/xiselectev.c xorg-server-21.1.12/Xi/xiselectev.c --- xorg-server-21.1.11/Xi/xiselectev.c 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/Xi/xiselectev.c 2024-04-03 20:50:12.000000000 +0000 @@ -349,6 +349,7 @@ InputClientsPtr others = NULL; xXIEventMask *evmask = NULL; DeviceIntPtr dev; + uint32_t length; REQUEST(xXIGetSelectedEventsReq); REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq); @@ -418,10 +419,12 @@ } } + /* save the value before SRepXIGetSelectedEvents swaps it */ + length = reply.length; WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply); if (reply.num_masks) - WriteToClient(client, reply.length * 4, buffer); + WriteToClient(client, length * 4, buffer); free(buffer); return Success; diff -Nru xorg-server-21.1.11/aclocal.m4 xorg-server-21.1.12/aclocal.m4 --- xorg-server-21.1.11/aclocal.m4 2024-01-16 09:59:17.000000000 +0000 +++ xorg-server-21.1.12/aclocal.m4 2024-04-03 20:50:24.000000000 +0000 @@ -756,7 +756,7 @@ dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl -dnl Copyright (c) 2005, 2023, Oracle and/or its affiliates. +dnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the "Software"), @@ -793,7 +793,7 @@ # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_MACROS_VERSION],[ -m4_define([vers_have], [1.20.0]) +m4_define([vers_have], [1.19.3]) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_if(m4_cmp(maj_have, maj_needed), 0,, @@ -1123,7 +1123,7 @@ # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-xmlto option, it allows maximum flexibility in making decisions +# the --with-xmlto option, it allows maximum flexibilty in making decisions # as whether or not to use the xmlto package. When DEFAULT is not specified, # --with-xmlto assumes 'auto'. # @@ -1337,7 +1337,7 @@ # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-asciidoc option, it allows maximum flexibility in making decisions +# the --with-asciidoc option, it allows maximum flexibilty in making decisions # as whether or not to use the asciidoc package. When DEFAULT is not specified, # --with-asciidoc assumes 'auto'. # @@ -1407,7 +1407,7 @@ # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-doxygen option, it allows maximum flexibility in making decisions +# the --with-doxygen option, it allows maximum flexibilty in making decisions # as whether or not to use the doxygen package. When DEFAULT is not specified, # --with-doxygen assumes 'auto'. # @@ -1491,7 +1491,7 @@ # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-groff option, it allows maximum flexibility in making decisions +# the --with-groff option, it allows maximum flexibilty in making decisions # as whether or not to use the groff package. When DEFAULT is not specified, # --with-groff assumes 'auto'. # @@ -1599,7 +1599,7 @@ # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-fop option, it allows maximum flexibility in making decisions +# the --with-fop option, it allows maximum flexibilty in making decisions # as whether or not to use the fop package. When DEFAULT is not specified, # --with-fop assumes 'auto'. # @@ -1693,7 +1693,7 @@ # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with -# the --with-ps2pdf option, it allows maximum flexibility in making decisions +# the --with-ps2pdf option, it allows maximum flexibilty in making decisions # as whether or not to use the ps2pdf package. When DEFAULT is not specified, # --with-ps2pdf assumes 'auto'. # @@ -1748,7 +1748,7 @@ # not at the appropriate level. This macro enables a builder to skip all # documentation targets except traditional man pages. # Combined with the specific tool checking macros XORG_WITH_*, it provides -# maximum flexibility in controlling documentation building. +# maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc @@ -1781,7 +1781,7 @@ # # This macro enables a builder to skip all developer documentation. # Combined with the specific tool checking macros XORG_WITH_*, it provides -# maximum flexibility in controlling documentation building. +# maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc @@ -1814,7 +1814,7 @@ # # This macro enables a builder to skip all functional specification targets. # Combined with the specific tool checking macros XORG_WITH_*, it provides -# maximum flexibility in controlling documentation building. +# maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc @@ -2289,11 +2289,7 @@ AC_DEFUN([XORG_COMPILER_BRAND], [ AC_LANG_CASE( [C], [ - dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC - dnl and complains that AC_PROG_CC_C99 is obsolete - m4_version_prereq([2.70], - [AC_REQUIRE([AC_PROG_CC])], - [AC_REQUIRE([AC_PROG_CC_C99])]) + AC_REQUIRE([AC_PROG_CC_C99]) ], [C++], [ AC_REQUIRE([AC_PROG_CXX]) @@ -2309,7 +2305,7 @@ # Minimum version: 1.16.0 # # Test if the compiler works when passed the given flag as a command line argument. -# If it succeeds, the flag is appended to the given variable. If not, it tries the +# If it succeeds, the flag is appeneded to the given variable. If not, it tries the # next flag in the list until there are no more options. # # Note that this does not guarantee that the compiler supports the flag as some @@ -2325,11 +2321,7 @@ AC_LANG_CASE( [C], [ - dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC - dnl and complains that AC_PROG_CC_C99 is obsolete - m4_version_prereq([2.70], - [AC_REQUIRE([AC_PROG_CC])], - [AC_REQUIRE([AC_PROG_CC_C99])]) + AC_REQUIRE([AC_PROG_CC_C99]) define([PREFIX], [C]) define([CACHE_PREFIX], [cc]) define([COMPILER], [$CC]) @@ -2470,7 +2462,7 @@ # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) -# Turn some warnings into errors, so we don't accidentally get successful builds +# Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. if test "x$SELECTIVE_WERROR" = "xyes" ; then @@ -2579,35 +2571,23 @@ AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS])) ]) # XORG_STRICT_OPTION -# XORG_DEFAULT_NOCODE_OPTIONS -# --------------------------- -# Minimum version: 1.20.0 -# -# Defines default options for X.Org modules which don't compile code, -# such as fonts, bitmaps, cursors, and docs. -# -AC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [ -AC_REQUIRE([AC_PROG_INSTALL]) -XORG_RELEASE_VERSION -XORG_CHANGELOG -XORG_INSTALL -XORG_MANPAGE_SECTIONS -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], - [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) -]) # XORG_DEFAULT_NOCODE_OPTIONS - # XORG_DEFAULT_OPTIONS # -------------------- # Minimum version: 1.3.0 # -# Defines default options for X.Org modules which compile code. +# Defines default options for X.Org modules. # AC_DEFUN([XORG_DEFAULT_OPTIONS], [ AC_REQUIRE([AC_PROG_INSTALL]) XORG_COMPILER_FLAGS XORG_CWARNFLAGS XORG_STRICT_OPTION -XORG_DEFAULT_NOCODE_OPTIONS +XORG_RELEASE_VERSION +XORG_CHANGELOG +XORG_INSTALL +XORG_MANPAGE_SECTIONS +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], + [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) ]) # XORG_DEFAULT_OPTIONS # XORG_INSTALL() diff -Nru xorg-server-21.1.11/config.guess xorg-server-21.1.12/config.guess --- xorg-server-21.1.11/config.guess 2024-01-16 09:59:19.000000000 +0000 +++ xorg-server-21.1.12/config.guess 2024-04-03 20:50:26.000000000 +0000 @@ -1,10 +1,10 @@ -#!/usr/bin/sh +#! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2023 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2023-06-23' +timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ usage="\ Usage: $0 [OPTION] -Output the configuration name of the system '$me' is run on. +Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit @@ -60,13 +60,13 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2023 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try '$me --help' for more information." +Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -102,8 +102,8 @@ # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. -# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still -# use 'HOST_CC' if defined, but it is deprecated. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. @@ -459,7 +459,7 @@ UNAME_RELEASE=`uname -v` ;; esac - # Japanese Language versions have a version number like '4.1.3-JL'. + # Japanese Language versions have a version number like `4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; @@ -966,12 +966,6 @@ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; - x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) - GUESS="$UNAME_MACHINE-pc-managarm-mlibc" - ;; - *:[Mm]anagarm:*:*) - GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" - ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; @@ -1042,7 +1036,7 @@ k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; - loongarch32:Linux:*:* | loongarch64:Linux:*:*) + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) @@ -1157,27 +1151,16 @@ ;; x86_64:Linux:*:*) set_cc_for_build - CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then - ABI=64 - sed 's/^ //' << EOF > "$dummy.c" - #ifdef __i386__ - ABI=x86 - #else - #ifdef __ILP32__ - ABI=x32 - #endif - #endif -EOF - cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` - eval "$cc_set_abi" - case $ABI in - x86) CPU=i686 ;; - x32) LIBCABI=${LIBC}x32 ;; - esac + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI=${LIBC}x32 + fi fi - GUESS=$CPU-pc-linux-$LIBCABI + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC @@ -1197,7 +1180,7 @@ GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) - # If we were able to find 'uname', then EMX Unix compatibility + # If we were able to find `uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; @@ -1338,7 +1321,7 @@ GUESS=ns32k-sni-sysv fi ;; - PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; @@ -1384,11 +1367,8 @@ BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; - ppc:Haiku:*:*) # Haiku running on Apple PowerPC - GUESS=powerpc-apple-haiku - ;; - *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) - GUESS=$UNAME_MACHINE-unknown-haiku + x86_64:Haiku:*:*) + GUESS=x86_64-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE diff -Nru xorg-server-21.1.11/config.sub xorg-server-21.1.12/config.sub --- xorg-server-21.1.11/config.sub 2024-01-16 09:59:19.000000000 +0000 +++ xorg-server-21.1.12/config.sub 2024-04-03 20:50:26.000000000 +0000 @@ -1,10 +1,10 @@ -#!/usr/bin/sh +#! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2023 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2023-06-23' +timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -76,13 +76,13 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2023 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try '$me --help' for more information." +Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -130,7 +130,7 @@ # Separate into logical components for further validation case $1 in *-*-*-*-*) - echo "Invalid configuration '$1': more than four components" >&2 + echo Invalid configuration \`"$1"\': more than four components >&2 exit 1 ;; *-*-*-*) @@ -145,7 +145,7 @@ nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*) + | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 basic_os=$maybe_os ;; @@ -943,7 +943,7 @@ EOF IFS=$saved_IFS ;; - # We use 'pc' rather than 'unknown' + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) @@ -1075,7 +1075,7 @@ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) cpu=i586 ;; - pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*) + pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) cpu=i686 ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) @@ -1207,7 +1207,7 @@ | k1om \ | le32 | le64 \ | lm32 \ - | loongarch32 | loongarch64 \ + | loongarch32 | loongarch64 | loongarchx32 \ | m32c | m32r | m32rle \ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ @@ -1285,7 +1285,7 @@ ;; *) - echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 exit 1 ;; esac @@ -1341,10 +1341,6 @@ kernel=linux os=`echo "$basic_os" | sed -e 's|linux|gnu|'` ;; - managarm*) - kernel=managarm - os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'` - ;; *) kernel= os=$basic_os @@ -1758,7 +1754,7 @@ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ - | fiwix* | mlibc* ) + | fiwix* ) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) @@ -1766,11 +1762,8 @@ ;; none) ;; - kernel* ) - # Restricted further below - ;; *) - echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1779,24 +1772,14 @@ # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ - | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) + | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; - managarm-mlibc* | managarm-kernel* ) - ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. - echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 - exit 1 - ;; - -kernel* ) - echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 - exit 1 - ;; - *-kernel* ) - echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) @@ -1813,7 +1796,7 @@ # Blank kernel with real OS is always fine. ;; *-*) - echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 exit 1 ;; esac diff -Nru xorg-server-21.1.11/configure xorg-server-21.1.12/configure --- xorg-server-21.1.11/configure 2024-01-16 09:59:18.000000000 +0000 +++ xorg-server-21.1.12/configure 2024-04-03 20:50:25.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for xorg-server 21.1.11. +# Generated by GNU Autoconf 2.71 for xorg-server 21.1.12. # # Report bugs to . # @@ -682,8 +682,8 @@ # Identity of this package. PACKAGE_NAME='xorg-server' PACKAGE_TARNAME='xorg-server' -PACKAGE_VERSION='21.1.11' -PACKAGE_STRING='xorg-server 21.1.11' +PACKAGE_VERSION='21.1.12' +PACKAGE_STRING='xorg-server 21.1.12' PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/xserver/issues' PACKAGE_URL='' @@ -2004,7 +2004,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xorg-server 21.1.11 to adapt to many kinds of systems. +\`configure' configures xorg-server 21.1.12 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2075,7 +2075,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xorg-server 21.1.11:";; + short | recursive ) echo "Configuration of xorg-server 21.1.12:";; esac cat <<\_ACEOF @@ -2260,10 +2260,10 @@ org.x) --with-bundle-version=VERSION Version to use for X11.app's CFBundleVersion - (default: 21.1.11) + (default: 21.1.12) --with-bundle-version-string=VERSION Version to use for X11.app's - CFBundleShortVersionString (default: 21.1.11) + CFBundleShortVersionString (default: 21.1.12) --with-sparkle-feed-url=URL URL for the Sparkle feed (default: https://www.xquartz.org/releases/sparkle/release.xml) @@ -2480,7 +2480,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xorg-server configure 21.1.11 +xorg-server configure 21.1.12 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -3137,7 +3137,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xorg-server $as_me 21.1.11, which was +It was created by xorg-server $as_me 21.1.12, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3894,7 +3894,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -RELEASE_DATE="2024-01-16" +RELEASE_DATE="2024-04-03" RELEASE_NAME="Caramel Ice Cream" @@ -4412,7 +4412,7 @@ # Define the identity of the package. PACKAGE='xorg-server' - VERSION='21.1.11' + VERSION='21.1.12' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5948,6 +5948,7 @@ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } if test ${ac_cv_c_undeclared_builtin_options+y} @@ -8583,7 +8584,7 @@ # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) -# Turn some warnings into errors, so we don't accidentally get successful builds +# Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. if test "x$SELECTIVE_WERROR" = "xyes" ; then @@ -12438,8 +12439,6 @@ - - cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1` _ACEOF @@ -12646,7 +12645,6 @@ - # Check whether --with-doxygen was given. if test ${with_doxygen+y} then : @@ -15148,7 +15146,7 @@ lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -16068,11 +16066,8 @@ test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -18555,6 +18550,12 @@ lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -19036,6 +19037,9 @@ openbsd* | bitrig*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; esac ld_shlibs=yes @@ -19271,6 +19275,7 @@ case $cc_basename in tcc*) + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) @@ -19291,7 +19296,7 @@ fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -19968,6 +19973,7 @@ if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi + link_all_deplibs=no else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' @@ -19985,11 +19991,12 @@ # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -21089,9 +21096,6 @@ # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command @@ -21100,7 +21104,7 @@ # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -21112,6 +21116,18 @@ dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -25242,7 +25258,7 @@ then : withval=$with_bundle_version; BUNDLE_VERSION="${withval}" else $as_nop - BUNDLE_VERSION="21.1.11" + BUNDLE_VERSION="21.1.12" fi @@ -33811,7 +33827,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xorg-server $as_me 21.1.11, which was +This file was extended by xorg-server $as_me 21.1.12, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33879,7 +33895,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -xorg-server config.status 21.1.11 +xorg-server config.status 21.1.12 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" @@ -35105,7 +35121,6 @@ cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. diff -Nru xorg-server-21.1.11/debian/changelog xorg-server-21.1.12/debian/changelog --- xorg-server-21.1.11/debian/changelog 2024-04-18 11:01:14.000000000 +0000 +++ xorg-server-21.1.12/debian/changelog 2024-04-18 11:01:15.000000000 +0000 @@ -1,3 +1,51 @@ +xorg-server (2:21.1.12-1ubuntu1) noble; urgency=medium + + * Merge from Debian. + + -- Timo Aaltonen Fri, 12 Apr 2024 12:10:06 +0300 + +xorg-server (2:21.1.12-1) unstable; urgency=medium + + * New upstream release. + * render: Avoid possible double-free in ProcRenderAddGlyphs() + (closes: #1068470) + + -- Julien Cristau Wed, 10 Apr 2024 10:44:55 +0200 + +xorg-server (2:21.1.11-3) unstable; urgency=high + + [ Chris Hofstaedtler ] + * Use udev.pc to place udev files (Closes: #1057945) + + [ Julien Cristau ] + * Pull from upstream server-21.1-branch: + - hw/xfree86: fix NULL pointer refrence to mode name + - Initialize Mode->name in xf86CVTMode() + - Allow disabling byte-swapped clients + - Xext: SProcSyncCreateFence needs to swap drawable id too + - Xi: ProcXIGetSelectedEvents needs to use unswapped length to send + reply (CVE-2024-31080) + - Xi: ProcXIPassiveGrabDevice needs to use unswapped length to send + reply (CVE-2024-31081) + - Xquartz: ProcAppleDRICreatePixmap needs to use unswapped length to + send reply (CVE-2024-31082) + - render: fix refcounting of glyphs during ProcRenderAddGlyphs + (CVE-2024-31083) + * dix-Fix-use-after-free-in-input-device-shutdown.patch: drop (now upstream). + + -- Julien Cristau Wed, 03 Apr 2024 21:09:12 +0200 + +xorg-server (2:21.1.11-2ubuntu2) noble; urgency=medium + + * d/p/fix-suspend-resume-with-no-input-device.patch (LP: #2056331) + - Make sure info->active and info->vt_active are false + after dropping drm master. + - Normally, this is done when pausing the first + input device, so it breaks when there are no + input device at all. + + -- Talha Can Havadar Wed, 07 Mar 2024 16:29:06 +0900 + xorg-server (2:21.1.11-2ubuntu1) noble; urgency=medium * Merge from Debian. diff -Nru xorg-server-21.1.11/debian/control xorg-server-21.1.12/debian/control --- xorg-server-21.1.11/debian/control 2024-04-18 11:01:14.000000000 +0000 +++ xorg-server-21.1.12/debian/control 2024-04-18 11:01:15.000000000 +0000 @@ -47,7 +47,7 @@ libxinerama-dev, libxshmfence-dev (>= 1.1) [!hurd-any], # glamor - libepoxy-dev (>= 1.5.4) [linux-any kfreebsd-any], + libepoxy-dev [linux-any kfreebsd-any], libegl1-mesa-dev [linux-any kfreebsd-any], libgbm-dev (>= 10.2) [linux-any kfreebsd-any], # XCB bits for Xephyr @@ -75,7 +75,7 @@ libdbus-1-dev (>= 1.0) [linux-any], # systemd-daemon libsystemd-dev [linux-any], - libffi-dev, + systemd-dev [linux-any], Build-Depends-Indep: xz-utils Standards-Version: 3.9.8 Rules-Requires-Root: binary-targets diff -Nru xorg-server-21.1.11/debian/patches/dix-Fix-use-after-free-in-input-device-shutdown.patch xorg-server-21.1.12/debian/patches/dix-Fix-use-after-free-in-input-device-shutdown.patch --- xorg-server-21.1.11/debian/patches/dix-Fix-use-after-free-in-input-device-shutdown.patch 2024-04-18 11:01:14.000000000 +0000 +++ xorg-server-21.1.12/debian/patches/dix-Fix-use-after-free-in-input-device-shutdown.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -From 1801fe0ac3926882d47d7e1ad6c0518a2cdffd41 Mon Sep 17 00:00:00 2001 -From: Povilas Kanapickas -Date: Sun, 19 Dec 2021 18:11:07 +0200 -Subject: [PATCH] dix: Fix use after free in input device shutdown - -This fixes access to freed heap memory via dev->master. E.g. when -running BarrierNotify.ReceivesNotifyEvents/7 test from -xorg-integration-tests: - -==24736==ERROR: AddressSanitizer: heap-use-after-free on address -0x619000065020 at pc 0x55c450e2b9cf bp 0x7fffc532fd20 sp 0x7fffc532fd10 -READ of size 4 at 0x619000065020 thread T0 - #0 0x55c450e2b9ce in GetMaster ../../../dix/devices.c:2722 - #1 0x55c450e9d035 in IsFloating ../../../dix/events.c:346 - #2 0x55c4513209c6 in GetDeviceUse ../../../Xi/xiquerydevice.c:525 -../../../Xi/xichangehierarchy.c:95 - #4 0x55c450e3455c in RemoveDevice ../../../dix/devices.c:1204 -../../../hw/xfree86/common/xf86Xinput.c:1142 - #6 0x55c450e17b04 in CloseDeviceList ../../../dix/devices.c:1038 - #7 0x55c450e1de85 in CloseDownDevices ../../../dix/devices.c:1068 - #8 0x55c450e837ef in dix_main ../../../dix/main.c:302 - #9 0x55c4517a8d93 in main ../../../dix/stubmain.c:34 -(/lib/x86_64-linux-gnu/libc.so.6+0x28564) - #11 0x55c450d0113d in _start (/usr/lib/xorg/Xorg+0x117713d) - -0x619000065020 is located 160 bytes inside of 912-byte region -[0x619000064f80,0x619000065310) -freed by thread T0 here: -(/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf) - #1 0x55c450e19f1c in CloseDevice ../../../dix/devices.c:1014 - #2 0x55c450e343a4 in RemoveDevice ../../../dix/devices.c:1186 -../../../hw/xfree86/common/xf86Xinput.c:1142 - #4 0x55c450e17b04 in CloseDeviceList ../../../dix/devices.c:1038 - #5 0x55c450e1de85 in CloseDownDevices ../../../dix/devices.c:1068 - #6 0x55c450e837ef in dix_main ../../../dix/main.c:302 - #7 0x55c4517a8d93 in main ../../../dix/stubmain.c:34 -(/lib/x86_64-linux-gnu/libc.so.6+0x28564) - -previously allocated by thread T0 here: -(/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6) - #1 0x55c450e1c57b in AddInputDevice ../../../dix/devices.c:259 - #2 0x55c450e34840 in AllocDevicePair ../../../dix/devices.c:2755 - #3 0x55c45130318f in add_master ../../../Xi/xichangehierarchy.c:152 -../../../Xi/xichangehierarchy.c:465 - #5 0x55c4512cb9f5 in ProcIDispatch ../../../Xi/extinit.c:390 - #6 0x55c450e6a92b in Dispatch ../../../dix/dispatch.c:551 - #7 0x55c450e834b7 in dix_main ../../../dix/main.c:272 - #8 0x55c4517a8d93 in main ../../../dix/stubmain.c:34 -(/lib/x86_64-linux-gnu/libc.so.6+0x28564) - -The problem is caused by dev->master being not reset when disabling the -device, which then causes dangling pointer when the master device itself -is being deleted when exiting whole server. - -Note that RecalculateMasterButtons() requires dev->master to be still -valid, so we can reset it only at the end of function. - -Signed-off-by: Povilas Kanapickas ---- - dix/devices.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/dix/devices.c b/dix/devices.c -index e62c34c55e95..5f9ce1678fc4 100644 ---- a/dix/devices.c -+++ b/dix/devices.c -@@ -520,6 +520,7 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) - } - - RecalculateMasterButtons(dev); -+ dev->master = NULL; - - return TRUE; - } --- -2.43.0 - diff -Nru xorg-server-21.1.11/debian/patches/fix-suspend-resume-with-no-input-device.patch xorg-server-21.1.12/debian/patches/fix-suspend-resume-with-no-input-device.patch --- xorg-server-21.1.11/debian/patches/fix-suspend-resume-with-no-input-device.patch 1970-01-01 00:00:00.000000000 +0000 +++ xorg-server-21.1.12/debian/patches/fix-suspend-resume-with-no-input-device.patch 2024-04-18 11:01:15.000000000 +0000 @@ -0,0 +1,33 @@ +Description: x86/logind fix suspend/resume when there are no input devices + Make sure info->active and info->vt_active are false after + dropping drm master. + Normally, this is done when pausing the first input device, so it + breaks when there are no input device at all. +Bug: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1387 +Applied-Upstream: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/986?commit_id=cf7bda184213de6bab1923274a064f9e29ac2db4 +Last-Update: 2024-02-23 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/hw/xfree86/os-support/linux/systemd-logind.c ++++ b/hw/xfree86/os-support/linux/systemd-logind.c +@@ -310,15 +310,19 @@ + */ + void systemd_logind_drop_master(void) + { ++ struct systemd_logind_info *info = &logind_info; + int i; ++ /* Our VT_PROCESS usage guarantees we've already given up the vt */ ++ info->active = info->vt_active = FALSE; + for (i = 0; i < xf86_num_platform_devices; i++) { + if (xf86_platform_devices[i].flags & XF86_PDEV_SERVER_FD) { + dbus_int32_t major, minor; +- struct systemd_logind_info *info = &logind_info; + + xf86_platform_devices[i].flags |= XF86_PDEV_PAUSED; + major = xf86_platform_odev_attributes(i)->major; + minor = xf86_platform_odev_attributes(i)->minor; ++ LogMessage(X_INFO, "systemd-logind: drop master for %u:%u\n", ++ major, minor); + systemd_logind_ack_pause(info, minor, major); + } + } diff -Nru xorg-server-21.1.11/debian/patches/series xorg-server-21.1.12/debian/patches/series --- xorg-server-21.1.11/debian/patches/series 2024-04-18 11:01:14.000000000 +0000 +++ xorg-server-21.1.12/debian/patches/series 2024-04-18 11:01:15.000000000 +0000 @@ -5,7 +5,6 @@ 05_Revert-Unload-submodules.diff 06_use-intel-only-on-pre-gen4.diff 07_use-modesetting-driver-by-default-on-GeForce.diff -dix-Fix-use-after-free-in-input-device-shutdown.patch ## Ubuntu patches, not upstreamable @@ -18,6 +17,7 @@ no-nv.patch ## upstream patches +fix-suspend-resume-with-no-input-device.patch # hybrid graphics fixes xf86-ignore-conflicting-rr-caps.patch diff -Nru xorg-server-21.1.11/debian/rules xorg-server-21.1.12/debian/rules --- xorg-server-21.1.11/debian/rules 2024-04-18 11:01:14.000000000 +0000 +++ xorg-server-21.1.12/debian/rules 2024-04-18 11:01:15.000000000 +0000 @@ -4,6 +4,10 @@ include /usr/share/dpkg/architecture.mk +ifeq ($(DEB_HOST_ARCH_OS), linux) +deb_udevdir = $(shell pkg-config --variable=udevdir udev) +endif + ifeq (,$(filter noudeb, $(DEB_BUILD_PROFILES))) with_udeb = yes endif @@ -151,11 +155,11 @@ install -m 755 -d debian/xserver-xorg-core/usr/share/bug/xserver-xorg-core install -m 755 debian/xserver-xorg-core.bug.script debian/xserver-xorg-core/usr/share/bug/xserver-xorg-core/script ifeq ($(DEB_HOST_ARCH_OS), linux) - install -d debian/xserver-xorg-core/lib/udev/rules.d - install -m 644 debian/local/64-xorg-xkb.rules debian/xserver-xorg-core/lib/udev/rules.d + install -d debian/xserver-xorg-core$(deb_udevdir)/rules.d + install -m 644 debian/local/64-xorg-xkb.rules debian/xserver-xorg-core$(deb_udevdir)/rules.d ifeq ($(with_udeb),yes) - install -d debian/xserver-xorg-core-udeb/lib/udev/rules.d - install -m 644 debian/local/64-xorg-xkb.rules debian/xserver-xorg-core-udeb/lib/udev/rules.d + install -d debian/xserver-xorg-core-udeb$(deb_udevdir)/rules.d + install -m 644 debian/local/64-xorg-xkb.rules debian/xserver-xorg-core-udeb$(deb_udevdir)/rules.d endif endif diff -Nru xorg-server-21.1.11/dix/devices.c xorg-server-21.1.12/dix/devices.c --- xorg-server-21.1.11/dix/devices.c 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/dix/devices.c 2024-04-03 20:50:12.000000000 +0000 @@ -536,6 +536,7 @@ } RecalculateMasterButtons(dev); + dev->master = NULL; return TRUE; } diff -Nru xorg-server-21.1.11/dix/dispatch.c xorg-server-21.1.12/dix/dispatch.c --- xorg-server-21.1.11/dix/dispatch.c 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/dix/dispatch.c 2024-04-03 20:50:12.000000000 +0000 @@ -3780,9 +3780,11 @@ auth_proto = (char *) prefix + sz_xConnClientPrefix; auth_string = auth_proto + pad_to_int32(prefix->nbytesAuthProto); - if ((client->req_len << 2) != sz_xReq + sz_xConnClientPrefix + - pad_to_int32(prefix->nbytesAuthProto) + - pad_to_int32(prefix->nbytesAuthString)) + if (client->swapped && !AllowByteSwappedClients) { + reason = "Prohibited client endianess, see the Xserver man page "; + } else if ((client->req_len << 2) != sz_xReq + sz_xConnClientPrefix + + pad_to_int32(prefix->nbytesAuthProto) + + pad_to_int32(prefix->nbytesAuthString)) reason = "Bad length"; else if ((prefix->majorVersion != X_PROTOCOL) || (prefix->minorVersion != X_PROTOCOL_REVISION)) diff -Nru xorg-server-21.1.11/hw/xfree86/common/xf86Config.c xorg-server-21.1.12/hw/xfree86/common/xf86Config.c --- xorg-server-21.1.11/hw/xfree86/common/xf86Config.c 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/hw/xfree86/common/xf86Config.c 2024-04-03 20:50:12.000000000 +0000 @@ -646,6 +646,7 @@ FLAG_MAX_CLIENTS, FLAG_IGLX, FLAG_DEBUG, + FLAG_ALLOW_BYTE_SWAPPED_CLIENTS, } FlagValues; /** @@ -705,6 +706,8 @@ {0}, FALSE}, {FLAG_DEBUG, "Debug", OPTV_STRING, {0}, FALSE}, + {FLAG_ALLOW_BYTE_SWAPPED_CLIENTS, "AllowByteSwappedClients", OPTV_BOOLEAN, + {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE}, }; @@ -746,6 +749,14 @@ xf86Msg(X_CONFIG, "Ignoring ABI Version\n"); } + xf86GetOptValBool(FlagOptions, FLAG_ALLOW_BYTE_SWAPPED_CLIENTS, &AllowByteSwappedClients); + if (AllowByteSwappedClients) { + xf86Msg(X_CONFIG, "Allowing byte-swapped clients\n"); + } + else { + xf86Msg(X_CONFIG, "Prohibiting byte-swapped clients\n"); + } + if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_DEVICES)) { xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_DEVICES, &xf86Info.autoAddDevices); diff -Nru xorg-server-21.1.11/hw/xfree86/common/xf86Mode.c xorg-server-21.1.12/hw/xfree86/common/xf86Mode.c --- xorg-server-21.1.11/hw/xfree86/common/xf86Mode.c 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/hw/xfree86/common/xf86Mode.c 2024-04-03 20:50:12.000000000 +0000 @@ -507,6 +507,8 @@ /* scan through the modes in the sort order above */ if ((p->type & type) != type) continue; + if (p->name == NULL) + continue; if (strcmp(p->name, modep->name) == 0) { diff -Nru xorg-server-21.1.11/hw/xfree86/man/xorg.conf.man xorg-server-21.1.12/hw/xfree86/man/xorg.conf.man --- xorg-server-21.1.11/hw/xfree86/man/xorg.conf.man 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/hw/xfree86/man/xorg.conf.man 2024-04-03 20:50:12.000000000 +0000 @@ -677,6 +677,9 @@ or .BR sync . Unset by default. +.TP 7 +.BI "Option \*qAllowByteSwappedClients\*q \*q" boolean \*q +Allow clients with a different byte-order than the server. Enabled by default. .SH "MODULE SECTION" The .B Module diff -Nru xorg-server-21.1.11/hw/xfree86/modes/xf86Modes.c xorg-server-21.1.12/hw/xfree86/modes/xf86Modes.c --- xorg-server-21.1.11/hw/xfree86/modes/xf86Modes.c 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/hw/xfree86/modes/xf86Modes.c 2024-04-03 20:50:12.000000000 +0000 @@ -803,10 +803,14 @@ { struct libxcvt_mode_info *libxcvt_mode_info; DisplayModeRec *Mode = xnfcalloc(1, sizeof(DisplayModeRec)); + char *tmp; libxcvt_mode_info = libxcvt_gen_mode_info(HDisplay, VDisplay, VRefresh, Reduced, Interlaced); + XNFasprintf(&tmp, "%dx%d", HDisplay, VDisplay); + Mode->name = tmp; + Mode->VDisplay = libxcvt_mode_info->vdisplay; Mode->HDisplay = libxcvt_mode_info->hdisplay; Mode->Clock = libxcvt_mode_info->dot_clock; diff -Nru xorg-server-21.1.11/hw/xquartz/xpr/appledri.c xorg-server-21.1.12/hw/xquartz/xpr/appledri.c --- xorg-server-21.1.11/hw/xquartz/xpr/appledri.c 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/hw/xquartz/xpr/appledri.c 2024-04-03 20:50:12.000000000 +0000 @@ -272,6 +272,7 @@ xAppleDRICreatePixmapReply rep; int width, height, pitch, bpp; void *ptr; + CARD32 stringLength; REQUEST_SIZE_MATCH(xAppleDRICreatePixmapReq); @@ -307,6 +308,7 @@ if (sizeof(rep) != sz_xAppleDRICreatePixmapReply) ErrorF("error sizeof(rep) is %zu\n", sizeof(rep)); + stringLength = rep.stringLength; /* save unswapped value */ if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -319,7 +321,7 @@ } WriteToClient(client, sizeof(rep), &rep); - WriteToClient(client, rep.stringLength, path); + WriteToClient(client, stringLength, path); return Success; } diff -Nru xorg-server-21.1.11/hw/xwin/winprefslex.c xorg-server-21.1.12/hw/xwin/winprefslex.c --- xorg-server-21.1.11/hw/xwin/winprefslex.c 2024-01-16 09:59:41.000000000 +0000 +++ xorg-server-21.1.12/hw/xwin/winprefslex.c 2024-04-03 20:51:01.000000000 +0000 @@ -1,5 +1,5 @@ -#line 2 "winprefslex.c" +#line 3 "winprefslex.c" #define YY_INT_ALIGNED short int @@ -687,9 +687,9 @@ return ptr; } -#line 690 "winprefslex.c" +#line 691 "winprefslex.c" #define YY_NO_INPUT 1 -#line 692 "winprefslex.c" +#line 693 "winprefslex.c" #define INITIAL 0 @@ -906,7 +906,7 @@ { #line 63 "winprefslex.l" -#line 909 "winprefslex.c" +#line 910 "winprefslex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1145,7 +1145,7 @@ #line 100 "winprefslex.l" ECHO; YY_BREAK -#line 1148 "winprefslex.c" +#line 1149 "winprefslex.c" case YY_STATE_EOF(INITIAL): yyterminate(); diff -Nru xorg-server-21.1.11/include/opaque.h xorg-server-21.1.12/include/opaque.h --- xorg-server-21.1.11/include/opaque.h 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/include/opaque.h 2024-04-03 20:50:12.000000000 +0000 @@ -74,4 +74,6 @@ extern _X_EXPORT Bool CoreDump; extern _X_EXPORT Bool NoListenAll; +extern _X_EXPORT Bool AllowByteSwappedClients; + #endif /* OPAQUE_H */ diff -Nru xorg-server-21.1.11/ltmain.sh xorg-server-21.1.12/ltmain.sh --- xorg-server-21.1.11/ltmain.sh 2024-01-16 09:59:13.000000000 +0000 +++ xorg-server-21.1.12/ltmain.sh 2024-04-03 20:50:19.000000000 +0000 @@ -31,7 +31,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.7 +VERSION="2.4.7 Debian-2.4.7-5" package_revision=2.4.7 @@ -430,7 +430,7 @@ # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # -# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +# debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: @@ -1706,6 +1706,8 @@ { $debug_cmd + _G_rc_run_hooks=false + case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; @@ -2306,12 +2308,12 @@ compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.7 + version: $progname $scriptversion Debian-2.4.7-5 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . -GNU libtool home page: . +GNU libtool home page: . General help using GNU software: ." exit 0 } @@ -2510,6 +2512,8 @@ _G_rc_lt_options_prep=: + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2668,10 +2672,17 @@ # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" - # Keeping compiler generated duplicates in $postdeps and $predeps is not - # harmful, and is necessary in a majority of systems that use it to satisfy - # symbol dependencies. - opt_duplicate_compiler_generated_deps=: + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac $opt_help || { # Sanity checks first: @@ -7550,11 +7561,13 @@ # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC + # -static-* direct GCC to link specific libraries statically + # -fcilkplus Cilk Plus language extension features for C/C++ # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) + -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus|-Wa,*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result func_append compile_command " $arg" @@ -7847,7 +7860,10 @@ case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then @@ -8166,19 +8182,19 @@ # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done continue fi # $pass = conv @@ -9102,6 +9118,9 @@ revision=$number_minor lt_irix_increment=no ;; + *) + func_fatal_configuration "$modename: unknown library version type '$version_type'" + ;; esac ;; no) diff -Nru xorg-server-21.1.11/m4/libtool.m4 xorg-server-21.1.12/m4/libtool.m4 --- xorg-server-21.1.11/m4/libtool.m4 2024-01-16 09:59:13.000000000 +0000 +++ xorg-server-21.1.12/m4/libtool.m4 2024-04-03 20:50:19.000000000 +0000 @@ -730,7 +730,6 @@ cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. @@ -2887,9 +2886,6 @@ # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command @@ -2898,7 +2894,7 @@ # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -2910,6 +2906,18 @@ dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -3569,7 +3577,7 @@ lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -4075,7 +4083,8 @@ if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -4447,7 +4456,7 @@ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4715,6 +4724,12 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -4959,6 +4974,9 @@ ;; esac ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -5021,6 +5039,9 @@ openbsd* | bitrig*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -5256,6 +5277,7 @@ case $cc_basename in tcc*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) @@ -5276,7 +5298,7 @@ fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -5797,6 +5819,7 @@ if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' @@ -5814,11 +5837,12 @@ # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -6445,7 +6469,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else GXX=no @@ -6821,7 +6845,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -6886,7 +6910,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -7225,7 +7249,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # FIXME: insert proper C++ library support @@ -7309,7 +7333,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -7320,7 +7344,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' diff -Nru xorg-server-21.1.11/man/Xserver.man xorg-server-21.1.12/man/Xserver.man --- xorg-server-21.1.11/man/Xserver.man 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/man/Xserver.man 2024-04-03 20:50:12.000000000 +0000 @@ -114,6 +114,13 @@ .B \-bs disables backing store support on all screens. .TP 8 +.B \+byteswappedclients +Allow connections from clients with an endianess different to that of the server. +This is the default unless \fB\-byteswappedclients\fP is specified. +.TP 8 +.B \-byteswappedclients +Prohibit connections from clients with an endianess different to that of the server. +.TP 8 .B \-c turns off key-click. .TP 8 diff -Nru xorg-server-21.1.11/os/utils.c xorg-server-21.1.12/os/utils.c --- xorg-server-21.1.11/os/utils.c 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/os/utils.c 2024-04-03 20:50:12.000000000 +0000 @@ -189,6 +189,8 @@ Bool enableIndirectGLX = FALSE; +Bool AllowByteSwappedClients = TRUE; + #ifdef PANORAMIX Bool PanoramiXExtensionDisabledHack = FALSE; #endif @@ -523,6 +525,8 @@ ErrorF("-br create root window with black background\n"); ErrorF("+bs enable any backing store support\n"); ErrorF("-bs disable any backing store support\n"); + ErrorF("+byteswappedclients Allow clients with endianess different to that of the server\n"); + ErrorF("-byteswappedclients Prohibit clients with endianess different to that of the server\n"); ErrorF("-c turns off key-click\n"); ErrorF("c # key-click volume (0-100)\n"); ErrorF("-cc int default color visual class\n"); @@ -719,6 +723,11 @@ else UseMsg(); } + else if (strcmp(argv[i], "-byteswappedclients") == 0) { + AllowByteSwappedClients = FALSE; + } else if (strcmp(argv[i], "+byteswappedclients") == 0) { + AllowByteSwappedClients = TRUE; + } else if (strcmp(argv[i], "-br") == 0); /* default */ else if (strcmp(argv[i], "+bs") == 0) enableBackingStore = TRUE; diff -Nru xorg-server-21.1.11/render/glyph.c xorg-server-21.1.12/render/glyph.c --- xorg-server-21.1.11/render/glyph.c 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/render/glyph.c 2024-04-18 11:01:15.000000000 +0000 @@ -245,10 +245,11 @@ } } -static void +void FreeGlyph(GlyphPtr glyph, int format) { CheckDuplicates(&globalGlyphs[format], "FreeGlyph"); + BUG_RETURN(glyph->refcnt == 0); if (--glyph->refcnt == 0) { GlyphRefPtr gr; int i; @@ -290,8 +291,6 @@ gr = FindGlyphRef(&globalGlyphs[glyphSet->fdepth], signature, TRUE, glyph->sha1); if (gr->glyph && gr->glyph != DeletedGlyph && gr->glyph != glyph) { - FreeGlyphPicture(glyph); - dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH); glyph = gr->glyph; } else if (gr->glyph != glyph) { @@ -354,7 +353,7 @@ glyph = (GlyphPtr) malloc(size); if (!glyph) return 0; - glyph->refcnt = 0; + glyph->refcnt = 1; glyph->size = size + sizeof(xGlyphInfo); glyph->info = *gi; dixInitPrivates(glyph, (char *) glyph + head_size, PRIVATE_GLYPH); diff -Nru xorg-server-21.1.11/render/glyphstr.h xorg-server-21.1.12/render/glyphstr.h --- xorg-server-21.1.11/render/glyphstr.h 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/render/glyphstr.h 2024-04-03 20:50:12.000000000 +0000 @@ -109,6 +109,8 @@ extern GlyphPtr AllocateGlyph(xGlyphInfo * gi, int format); +extern void FreeGlyph(GlyphPtr glyph, int format); + extern Bool ResizeGlyphSet(GlyphSetPtr glyphSet, CARD32 change); diff -Nru xorg-server-21.1.11/render/render.c xorg-server-21.1.12/render/render.c --- xorg-server-21.1.11/render/render.c 2024-01-16 09:59:07.000000000 +0000 +++ xorg-server-21.1.12/render/render.c 2024-04-03 20:50:12.000000000 +0000 @@ -1076,6 +1076,7 @@ if (glyph_new->glyph && glyph_new->glyph != DeletedGlyph) { glyph_new->found = TRUE; + ++glyph_new->glyph->refcnt; } else { GlyphPtr glyph; @@ -1168,8 +1169,10 @@ err = BadAlloc; goto bail; } - for (i = 0; i < nglyphs; i++) + for (i = 0; i < nglyphs; i++) { AddGlyph(glyphSet, glyphs[i].glyph, glyphs[i].id); + FreeGlyph(glyphs[i].glyph, glyphSet->fdepth); + } if (glyphsBase != glyphsLocal) free(glyphsBase); @@ -1179,9 +1182,13 @@ FreePicture((void *) pSrc, 0); if (pSrcPix) FreeScratchPixmapHeader(pSrcPix); - for (i = 0; i < nglyphs; i++) - if (glyphs[i].glyph && !glyphs[i].found) - free(glyphs[i].glyph); + for (i = 0; i < nglyphs; i++) { + if (glyphs[i].glyph) { + --glyphs[i].glyph->refcnt; + if (!glyphs[i].found) + free(glyphs[i].glyph); + } + } if (glyphsBase != glyphsLocal) free(glyphsBase); return err;