xserver/render
Peter Hutterer bdca6c3d1f 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: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1463>
2024-04-02 19:19:40 -07:00
..
animcur.c render: move private definitions out of picturestr.h 2024-03-03 22:54:16 +00:00
filter.c
glyph.c render: fix refcounting of glyphs during ProcRenderAddGlyphs 2024-04-02 19:19:40 -07:00
glyphstr.h render: move private definitions out of public glyphstr.h 2024-03-03 22:54:16 +00:00
glyphstr_priv.h render: fix refcounting of glyphs during ProcRenderAddGlyphs 2024-04-02 19:19:40 -07:00
matrix.c
meson.build meson: hide C API if Xorg is disabled (like autotools) 2021-03-11 00:22:36 +00:00
miindex.c
mipict.c mi: Add a default no-op miSourceValidate 2019-10-30 16:26:01 +00:00
mipict.h
mirect.c
mitrap.c
mitri.c
picture.c render: move private definitions out of public glyphstr.h 2024-03-03 22:54:16 +00:00
picture.h glamor: fix CbCr format handling 2022-12-01 08:41:57 +00:00
picturestr.h render: move private definitions out of public glyphstr.h 2024-03-03 22:54:16 +00:00
picturestr_priv.h render: move private definitions out of picturestr.h 2024-03-03 22:54:16 +00:00
render.c render: fix refcounting of glyphs during ProcRenderAddGlyphs 2024-04-02 19:19:40 -07:00