Skip to content

backport WIP queue onto 25.0 - #2170

Draft
metux wants to merge 14 commits into
release/25.0from
rfc/backport-25.0
Draft

backport WIP queue onto 25.0#2170
metux wants to merge 14 commits into
release/25.0from
rfc/backport-25.0

Conversation

@metux

@metux metux commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Backports from Xorg for 25.0 release line

PRs:

@metux
metux requested a review from a team April 10, 2026 18:22
@metux
metux marked this pull request as draft April 10, 2026 18:23
@metux
metux force-pushed the rfc/backport-25.0 branch 6 times, most recently from 585110e to c50a90c Compare April 18, 2026 17:41
@metux
metux force-pushed the rfc/backport-25.0 branch 8 times, most recently from 90fb110 to 16de288 Compare April 28, 2026 09:30
@metux
metux force-pushed the rfc/backport-25.0 branch 2 times, most recently from 6896aa9 to 60079d0 Compare May 8, 2026 08:06
@metux
metux force-pushed the rfc/backport-25.0 branch 2 times, most recently from 78eb773 to 495c165 Compare May 18, 2026 18:32
@metux
metux force-pushed the rfc/backport-25.0 branch 3 times, most recently from a0614a0 to 45b453c Compare June 3, 2026 13:51
@X11Libre X11Libre deleted a comment from github-actions Bot Jun 5, 2026
@metux
metux force-pushed the rfc/backport-25.0 branch 5 times, most recently from d1103a9 to d6a6e64 Compare June 8, 2026 10:55
@metux
metux force-pushed the rfc/backport-25.0 branch 2 times, most recently from 613a3d9 to 8ba589a Compare June 12, 2026 10:54
@metux
metux force-pushed the rfc/backport-25.0 branch 2 times, most recently from ea829d8 to f0004dd Compare June 16, 2026 10:36
jon-turney and others added 4 commits July 22, 2026 13:05
- fb/fbpixmap.c: check width*bpp and height*paddedWidth overflows
- hw/xfree86/common/xf86fbman.c: check length+gran-1 overflow, safe h computation, h*w overflow
- hw/xfree86/drivers/modesetting/drmmode_display.c: validate multiplications before allocating shadow buffers
- hw/xquartz/xpr/xprScreen.c: check displayCount * sizeof overflow
- hw/xnest/Color.c: check ncolors * sizeof(uint32_t) overflow

These prevent potential heap overflows due to wrapped sizes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
- xkb/ddxLoad.c: replace mktemp() with GetTempFileNameA() on Windows;
- xkb/ddxLoad.c: add safe_path() validation and sanitize XkbBaseDirectory and XkbBinDirectory;
- bundle-main.c: replace tmpnam() with mkstemp() and unlink to prevent symlink attacks.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
- LoadImageComma: dynamically allocate buffer based on path lengths instead of fixed-size stack buffer
- LoadPreferences: use snprintf to avoid overflow when constructing ~/.XWinrc path

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
@metux
metux force-pushed the rfc/backport-25.0 branch from f0004dd to 5d96b7d Compare July 22, 2026 11:07
whot and others added 8 commits July 22, 2026 13:15
…monMakeCurrent

oldTag in CommonMakeCurrent() is a pointer to cl->contextTags[...].
CommonMakeCurrent() may realloc(cl->contextTags) and thus move the
memory, leaving oldTag as dangling pointer.

If we then GlxFreeContextTag(oldTag) we end up writing into freed
memory.

Fix this by freeing oldTag before CommonMakeNewCurrent().

This vulnerability was discovered by:
Anonymous working with Trend Micro Zero Day Initiative

CVE-2026-56000/ZDI-CAN-30561

Fixes: 4781f2a ("GLX: Free the tag of the old context later")
Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2250>
PR: #3336
GLYPHWIDTHPIXELS and GLYPHHEIGHTPIXELS compute glyph dimensions from
signed INT16 fields. A crafted PCF font can produce negative results
(e.g. rightSideBearing < leftSideBearing).

All callees have a while (height--) loop which will end up in OOB writes
for negative height values.

In the case of a negative height, some callees cast to size_t or end up
with negative strides.

The same pattern exists in fbPoloyGlyphBit, miPolyGlyphBlt and
glamor_poly_glyph_blt_gl, so let's fix all of them in one go.

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2250>
PR: #3337
…ounds

glamor_font_get() computes the atlas slot size from the font's declared
maxbounds, but copies each glyph's bitmap using the per-glyph metrics
(GLYPHHEIGHTPIXELS/GLYPHWIDTHBYTES macros). When a malicious PCF font
has per-glyph metrics exceeding maxbounds, the memcpy writes past the
heap-allocated atlas buffer. Negative per-glyph metrics are even worse:
the loop counter wraps to ~4 billion iterations (via unsigned cast) or
memcpy's size parameter wraps to SIZE_MAX.

The PCF parser in libXfont2 does not recompute maxbounds from per-glyph
data (only the BDF parser does), so the file's declared maxbounds values
are trusted as-is.

Reject fonts where any per-glyph metric is negative or exceeds the
atlas slot size, falling back to software rendering which uses per-glyph
metrics directly without an atlas.

This vulnerability was discovered by:
Anonymous working with Trend Micro Zero Day Initiative

CVE-2026-55999/ZDI-CAN-30498

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2250>
PR: #3338
If fdopen() fails, close the unused pipe fd, free the pid list node,
and restore the smart scheduler signal before returning NULL.
Previously the fd would leak and the node would be added to pidlist
with a NULL fp.

Signed-off-by: dongshengyuan <545258830@qq.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2236>
PR: #3340
When a platform GPU device is added at runtime, xf86platformAddDevice
calls AddGPUScreen without first assigning the EnableDisableFBAccess and
SetDGAMode function-pointer defaults. The boot path in xf86Init.c sets
both of these for every GPU screen before it calls AddGPUScreen, so a
screen added by hotplug is left with SetDGAMode == NULL.

modesetting's ScreenInit reaches xf86CrtcScreenInit, which wraps
DGACloseScreen onto the screen regardless of how the screen was created.
When the device is later removed, xf86platformRemoveDevice tears the GPU
screen down and DGACloseScreen calls pScrn->SetDGAMode(pScrn, 0, NULL).
On a hotplug-added screen that pointer is NULL, so the call faults and
takes down the server with a SIGSEGV.

This is not DisplayLink-specific: any modesetting platform GPU screen
added at runtime and later removed hits it. DisplayLink/evdi just makes
it easy to reproduce, because the evdi platform device is added and
reconfigured at runtime.

Mirror the boot path by assigning the same defaults in
xf86platformAddDevice immediately before the AddGPUScreen call.

Closes: #1904
Signed-off-by: Gary T. Giesen <ggiesen@giesen.me>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2244>
PR: #3341
…_front_process:

-[NSApplication activateIgnoringOtherApps:] is no longer supported under the macOS cooperative activation model,
so use the new xp_window_activate() API instead.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
PR: #3342
…path

The indirect GLX make-current path failed silently: an unsuccessful surface creation or context attach
surfaced only as a generic GLXBadContext to the client, with nothing in the server log to indicate which
Xplugin call rejected the request. Add error logging on each failure branch of the make-current, surface
creation, and surface configuration code so the offending call and its error code are visible.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
PR: #3343
@metux
metux force-pushed the rfc/backport-25.0 branch from 8c703ea to 85e673f Compare July 22, 2026 11:18
In a987fc7 commit glx library is
statically linked which makes all glx library variables dublicated in
glx.so and glamoregl.so files and leads 'split-brain' problem where same
symbols exist in different depending on context (this evident when it
called using functions with static attribute).

This patch exports neccesary glx symbols for glamor library.

Signed-off-by: Tautvis <gtautvis@gmail.com>

(cherry picked from commit 9b74a3a)
PR: #3473
Commit a987fc7 linked glx library
statically, which leaded dublicated glx extension symbols in glx.so and
glamoregl.so libraries. This commit do not link glx directly.

Signed-off-by: Tautvis <gtautvis@gmail.com>
(cherry picked from commit 6c75731)
PR: #3473
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants