~thopiekar/xorg-server/+git/xorg-xserver:xwayland-23.2

Last commit made on 2024-04-17
Get this branch:
git clone -b xwayland-23.2 https://git.launchpad.net/~thopiekar/xorg-server/+git/xorg-xserver

Branch merges

Branch information

Name:
xwayland-23.2
Repository:
lp:~thopiekar/xorg-server/+git/xorg-xserver

Recent commits

19d0576... by Enrico Weigelt, metux IT consult

m4: drop autoconf leftovers

these m4 macros had been used for autotools-based build system. But since this
had been replaced by meson, these files are obsolete now.

Fixes: c97397dc47f7a25858052f52dd9396ec564065b4
Signed-off-by: Enrico Weigelt, metux IT consult <email address hidden>
(cherry picked from commit 887fc7121bb6661808bb5bb58b44e624934730ca)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1493>

02db902... by Olivier Fourdan <email address hidden>

Revert "xwayland/glamor: Avoid implicit redirection with depth 32 parent windows"

There are a number of regressions and hard to reproduce issues that find
their roots in this change, so revert it until those can be ironed out
some more.

This reverts commit 4bb1f976d5397949be06510524bede5ae3bbfe0a.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1655
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1656
Signed-off-by: Olivier Fourdan <email address hidden>
(cherry picked from commit a65bb8480af8931b8e18b6c0630ef664249c64ca)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1488>

db9cde0... by Olivier Fourdan <email address hidden>

Bump version to 23.2.6

Signed-off-by: Olivier Fourdan <email address hidden>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1480>

c3c2218... by Olivier Fourdan <email address hidden>

render: Avoid possible double-free in ProcRenderAddGlyphs()

ProcRenderAddGlyphs() adds the glyph to the glyphset using AddGlyph() and
then frees it using FreeGlyph() to decrease the reference count, after
AddGlyph() has increased it.

AddGlyph() however may chose to reuse an existing glyph if it's already
in the glyphSet, and free the glyph that was given, in which case the
caller function, ProcRenderAddGlyphs() will call FreeGlyph() on an
already freed glyph, as reported by ASan:

  READ of size 4 thread T0
    #0 in FreeGlyph xserver/render/glyph.c:252
    #1 in ProcRenderAddGlyphs xserver/render/render.c:1174
    #2 in Dispatch xserver/dix/dispatch.c:546
    #3 in dix_main xserver/dix/main.c:271
    #4 in main xserver/dix/stubmain.c:34
    #5 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #6 in __libc_start_main_impl ../csu/libc-start.c:360
    #7 (/usr/bin/Xwayland+0x44fe4)
  Address is located 0 bytes inside of 64-byte region
  freed by thread T0 here:
    #0 in __interceptor_free libsanitizer/asan/asan_malloc_linux.cpp:52
    #1 in _dixFreeObjectWithPrivates xserver/dix/privates.c:538
    #2 in AddGlyph xserver/render/glyph.c:295
    #3 in ProcRenderAddGlyphs xserver/render/render.c:1173
    #4 in Dispatch xserver/dix/dispatch.c:546
    #5 in dix_main xserver/dix/main.c:271
    #6 in main xserver/dix/stubmain.c:34
    #7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
  previously allocated by thread T0 here:
    #0 in __interceptor_malloc libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 in AllocateGlyph xserver/render/glyph.c:355
    #2 in ProcRenderAddGlyphs xserver/render/render.c:1085
    #3 in Dispatch xserver/dix/dispatch.c:546
    #4 in dix_main xserver/dix/main.c:271
    #5 in main xserver/dix/stubmain.c:34
    #6 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
  SUMMARY: AddressSanitizer: heap-use-after-free xserver/render/glyph.c:252 in FreeGlyph

To avoid that, make sure not to free the given glyph in AddGlyph().

v2: Simplify the test using the boolean returned from AddGlyph() (Michel)
v3: Simplify even more by not freeing the glyph in AddGlyph() (Peter)

Fixes: bdca6c3d1 - render: fix refcounting of glyphs during ProcRenderAddGlyphs
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1659
Signed-off-by: Olivier Fourdan <email address hidden>
(cherry picked from commit 337d8d48b618d4fc0168a7b978be4c3447650b04)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1478>

f69899a... by Florian Weimer

xwayland: Use correct pointer types on i386

And other 32-bit architectures, where uint32_t and CARD32 are
not the same type. Otherwise the build will fail with GCC 14
with errors like:

../hw/xwayland/xwayland-glamor.c: In function ‘xwl_glamor_get_formats’:
../hw/xwayland/xwayland-glamor.c:291:43: error: passing argument 3 of ‘xwl_get_formats_for_device’ from incompatible pointer type [-Wincompatible-pointer-types]
  291 | num_formats, formats);
      | ^~~~~~~~~~~
      | |
      | CARD32 * {aka long unsigned int *}
../hw/xwayland/xwayland-glamor.c:238:38: note: expected ‘uint32_t *’ {aka ‘unsigned int *’} but argument is of type ‘CARD32 *’ {aka ‘long unsigned int *’}
  238 | uint32_t *num_formats, uint32_t **formats)
      | ~~~~~~~~~~^~~~~~~~~~~
../hw/xwayland/xwayland-glamor.c:291:56: error: passing argument 4 of ‘xwl_get_formats_for_device’ from incompatible pointer type [-Wincompatible-pointer-types]
  291 | num_formats, formats);
      | ^~~~~~~
      | |
      | CARD32 ** {aka long unsigned int **}
../hw/xwayland/xwayland-glamor.c:238:62: note: expected ‘uint32_t **’ {aka ‘unsigned int **’} but argument is of type ‘CARD32 **’ {aka ‘long unsigned int **’}
  238 | uint32_t *num_formats, uint32_t **formats)
      | ~~~~~~~~~~~^~~~~~~
../hw/xwayland/xwayland-glamor.c:295:28: error: passing argument 3 of ‘xwl_get_formats’ from incompatible pointer type [-Wincompatible-pointer-types]
  295 | num_formats, formats);
      | ^~~~~~~~~~~
      | |
      | CARD32 * {aka long unsigned int *}
../hw/xwayland/xwayland-glamor.c:217:26: note: expected ‘uint32_t *’ {aka ‘unsigned int *’} but argument is of type ‘CARD32 *’ {aka ‘long unsigned int *’}
  217 | uint32_t *num_formats, uint32_t **formats)
      | ~~~~~~~~~~^~~~~~~~~~~
../hw/xwayland/xwayland-glamor.c:295:41: error: passing argument 4 of ‘xwl_get_formats’ from incompatible pointer type [-Wincompatible-pointer-types]
  295 | num_formats, formats);
      | ^~~~~~~
      | |
      | CARD32 ** {aka long unsigned int **}
../hw/xwayland/xwayland-glamor.c:217:50: note: expected ‘uint32_t **’ {aka ‘unsigned int **’} but argument is of type ‘CARD32 **’ {aka ‘long unsigned int **’}
  217 | uint32_t *num_formats, uint32_t **formats)
      | ~~~~~~~~~~~^~~~~~~

(cherry picked from commit f0a187f55d76139225c11ce92ab69816d46db55c)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1470>

28cfd2f... by Olivier Fourdan <email address hidden>

Bump version to 23.2.5

Signed-off-by: Olivier Fourdan <email address hidden>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1465>

01941a8... by Peter Hutterer

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

(backported from commit bdca6c3d1f5057eeb31609b1280fc93237b00c77)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1464>

672b26d... by Alan Coopersmith

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 <email address hidden>
(cherry picked from commit 3e77295f888c67fc7645db5d0c00926a29ffecee)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1464>

bd16cc8... by Alan Coopersmith

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 <email address hidden>
(cherry picked from commit 96798fc1967491c80a4d0c8d9e0a80586cb2152b)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1464>

4c8de12... by Peter Hutterer

dix: fix valuator copy/paste error in the DeviceStateNotify event

Fixes 219c54b8a3337456ce5270ded6a67bcde53553d5

(cherry picked from commit 133e0d651c5d12bf01999d6289e84e224ba77adc)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1452>