Commit Graph

19498 Commits

Author SHA1 Message Date
Alan Coopersmith dd823c7370 Revert "dix: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 5b541780c1.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 2de9ed7604 Revert "composite: use dixDestroyPixmap() instead of direct driver call"
This reverts commit eb5476381a.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith f0d6ec1c8a Revert "dbe: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 668d9fc40e.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith b91182cc16 Revert "dri3: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 4694b8488e.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith a5a89e9fa2 Revert "exa: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 9ca03e6da0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 5ead727d52 Revert "fb: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 08ec122fa7.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 6142282bfe Revert "glamor: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 7a0f8301c5.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 37d2db4398 Revert "miext: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 372a510ef0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 6f4ad392bd Revert "mi: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 4628254698.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 918a343710 Revert "randr: use dixDestroyPixmap() instead of direct driver call"
This reverts commit d2a93d0346.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 3802252040 Revert "render: use dixDestroyPixmap() instead of direct driver call"
This reverts commit c8607ca66f.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 9550b2d105 Revert "xnest: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 0a54e24721.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 51cfefd59f Revert "kdrive: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 4378656cbb.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 1b6b2bcee1 Revert "vfb: use dixDestroyPixmap() instead of direct driver call"
This reverts commit c117925ace.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith ab5e559771 Revert "xfree86: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 4d1953728e.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 21de52dfbe Revert "xwayland: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 0132baa422.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 23dcedf8ba Revert "glx: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 69837185c0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 8b47b53226 Revert "exa: simplify CreatePixmap()/DestroyPixmap() handlers error pathes"
This reverts commit ee798cf212.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith e48b1aaa97 Revert "dix: add in-code docs for dixDestroyPixmap()"
This reverts commit b61647f3a1.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Olivier Fourdan 0235121c6a xfree86: Check for RandR provider functions
Changing XRandR provider properties if the driver has set no provider
function such as the modesetting driver will cause a NULL pointer
dereference and a crash of the Xorg server.

Related to CVE-2025-49180

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:21:24 +02:00
Olivier Fourdan 3c3a4b767b randr: Check for overflow in RRChangeProviderProperty()
A client might send a request causing an integer overflow when computing
the total size to allocate in RRChangeProviderProperty().

To avoid the issue, check that total length in bytes won't exceed the
maximum integer value.

CVE-2025-49180

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:21:24 +02:00
Olivier Fourdan 2bde9ca49a record: Check for overflow in RecordSanityCheckRegisterClients()
The RecordSanityCheckRegisterClients() checks for the request length,
but does not check for integer overflow.

A client might send a very large value for either the number of clients
or the number of protocol ranges that will cause an integer overflow in
the request length computation, defeating the check for request length.

To avoid the issue, explicitly check the number of clients against the
limit of clients (which is much lower than an maximum integer value) and
the number of protocol ranges (multiplied by the record length) do not
exceed the maximum integer value.

This way, we ensure that the final computation for the request length
will not overflow the maximum integer limit.

CVE-2025-49179

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:21:24 +02:00
Olivier Fourdan d55c54cecb os: Account for bytes to ignore when sharing input buffer
When reading requests from the clients, the input buffer might be shared
and used between different clients.

If a given client sends a full request with non-zero bytes to ignore,
the bytes to ignore may still be non-zero even though the request is
full, in which case the buffer could be shared with another client who's
request will not be processed because of those bytes to ignore, leading
to a possible hang of the other client request.

To avoid the issue, make sure we have zero bytes to ignore left in the
input request when sharing the input buffer with another client.

CVE-2025-49178

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:21:24 +02:00
Olivier Fourdan ab02fb96b1 xfixes: Check request length for SetClientDisconnectMode
The handler of XFixesSetClientDisconnectMode does not check the client
request length.

A client could send a shorter request and read data from a former
request.

Fix the issue by checking the request size matches.

CVE-2025-49177

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Fixes: e167299f6 - xfixes: Add ClientDisconnectMode
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:21:24 +02:00
Olivier Fourdan 03731b326a os: Do not overflow the integer size with BigRequest
The BigRequest extension allows requests larger than the 16-bit length
limit.

It uses integers for the request length and checks for the size not to
exceed the maxBigRequestSize limit, but does so after translating the
length to integer by multiplying the given size in bytes by 4.

In doing so, it might overflow the integer size limit before actually
checking for the overflow, defeating the purpose of the test.

To avoid the issue, make sure to check that the request size does not
overflow the maxBigRequestSize limit prior to any conversion.

The caller Dispatch() function however expects the return value to be in
bytes, so we cannot just return the converted value in case of error, as
that would also overflow the integer size.

To preserve the existing API, we use a negative value for the X11 error
code BadLength as the function only return positive values, 0 or -1 and
update the caller Dispatch() function to take that case into account to
return the error code to the offending client.

CVE-2025-49176

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:21:10 +02:00
Olivier Fourdan 0885e0b262 render: Avoid 0 or less animated cursors
Animated cursors use a series of cursors that the client can set.

By default, the Xserver assumes at least one cursor is specified
while a client may actually pass no cursor at all.

That causes an out-of-bound read creating the animated cursor and a
crash of the Xserver:

 | Invalid read of size 8
 |    at 0x5323F4: AnimCursorCreate (animcur.c:325)
 |    by 0x52D4C5: ProcRenderCreateAnimCursor (render.c:1817)
 |    by 0x52DC80: ProcRenderDispatch (render.c:1999)
 |    by 0x4A1E9D: Dispatch (dispatch.c:560)
 |    by 0x4B0169: dix_main (main.c:284)
 |    by 0x4287F5: main (stubmain.c:34)
 |  Address 0x59aa010 is 0 bytes after a block of size 0 alloc'd
 |    at 0x48468D3: reallocarray (vg_replace_malloc.c:1803)
 |    by 0x52D3DA: ProcRenderCreateAnimCursor (render.c:1802)
 |    by 0x52DC80: ProcRenderDispatch (render.c:1999)
 |    by 0x4A1E9D: Dispatch (dispatch.c:560)
 |    by 0x4B0169: dix_main (main.c:284)
 |    by 0x4287F5: main (stubmain.c:34)
 |
 | Invalid read of size 2
 |    at 0x5323F7: AnimCursorCreate (animcur.c:325)
 |    by 0x52D4C5: ProcRenderCreateAnimCursor (render.c:1817)
 |    by 0x52DC80: ProcRenderDispatch (render.c:1999)
 |    by 0x4A1E9D: Dispatch (dispatch.c:560)
 |    by 0x4B0169: dix_main (main.c:284)
 |    by 0x4287F5: main (stubmain.c:34)
 |  Address 0x8 is not stack'd, malloc'd or (recently) free'd

To avoid the issue, check the number of cursors specified and return a
BadValue error in both the proc handler (early) and the animated cursor
creation (as this is a public function) if there is 0 or less cursor.

CVE-2025-49175

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:18:58 +02:00
Alan Coopersmith 3bdb541e04 Revert "os: move BUG_*() macros to own private header"
This reverts commit 346d5f5c35.
That commit did not handle copyright/license notices correctly.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2019>
2025-06-13 17:13:54 -07:00
Alan Coopersmith 538a6dd76f Revert "xfree86: mark LoaderShouldIgnoreABI() and LoaderGetABIVersion() deprecated"
This reverts commit 4f2c6c98b7.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2017>
2025-06-13 22:48:22 +00:00
Alan Coopersmith c7b69f1acb Revert "misc.h: drop LengthRestB() macro"
This reverts commit a6b2eb3780

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2015>
2025-06-13 22:30:27 +00:00
Alan Coopersmith cd583932a1 Revert "misc.h: move out checked_int64_(add|subtract)"
This reverts commit de0aed0543

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2014>
2025-06-13 22:13:22 +00:00
Alan Coopersmith 55ad737a9f Revert "misc.h: move out MAXEXTENSIONS to geext.c"
This reverts commit 80593ab279.

This is a fundamental property of the X11 core protocol,
there is no benefit to hiding it, it can't change.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2013>
2025-06-13 22:03:45 +00:00
Marge Bot ff8d250589 Merge branch 'xrandr-reverts' into 'master'
Revert "randr cleanups"

See merge request xorg/xserver!2012
2025-06-13 21:58:15 +00:00
Alan Coopersmith e3d0666386 Revert "randr: let SProc*'s call their Proc*'s directly"
This reverts commit ed17224403.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:44:43 -07:00
Alan Coopersmith c35a285398 Revert "randr: use explicit case statement instead of ProcRandrVector table"
This reverts commit 42677ae1e3.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:44:30 -07:00
Alan Coopersmith bc76e25994 Revert "randr: use explicit case statement instead of SProcRandrVector table"
This reverts commit 058815bed1.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:44:17 -07:00
Alan Coopersmith 9f72353a51 Revert "randr: RRCrtcCreate(): drop unnecessary zero assigments"
This reverts commit 6d2c42d0c8.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:44:02 -07:00
Alan Coopersmith 160abf285c Revert "randr: use struct initializer for reply structs"
This reverts commit 7eff742ef2.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:43:47 -07:00
Alan Coopersmith 9c53c6cf76 Revert "randr: ProcRRGetCrtcInfo(): use locally scoped variables"
This reverts commit 90abc95c85.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:43:36 -07:00
Alan Coopersmith c371d11af0 Revert "randr: ProcRRGetCrtcTransform(): split reply header and payload"
This reverts commit c6f1b8a735.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:43:23 -07:00
Alan Coopersmith 9b753c3970 Revert "randr: ProcRRGetMonitors() use SwapLongs instead of callbacks"
This reverts commit 203f59c6d3.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:43:00 -07:00
Alan Coopersmith a205917752 Revert "randr: ProcRRGetMonitors(): collect reply payload in temporary buffer"
This reverts commit 1bc6ca30a9.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:42:33 -07:00
Alan Coopersmith 896d9d3be8 Revert "randr: RROutputCreate(): use calloc()"
This reverts commit 3d3137513a.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:42:13 -07:00
Alan Coopersmith 9f2b9adbe3 Revert "randr: RRCreateProviderProperty(): use calloc()"
This reverts commit 05188ccec1.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:41:53 -07:00
Alan Coopersmith e77b465eb6 Revert "randr: ProcRRGetOutputProperty(): rename reply struct to "rep""
This reverts commit 53d43bd8dc.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:41:29 -07:00
Alan Coopersmith 01914b1c53 Revert "randr: ProcRRGetOutputProperty(): use SwapShort()/SwapLong()"
This reverts commit 8789be52a4.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:41:13 -07:00
Alan Coopersmith 3a76d12ef0 Revert "randr: ProcRRGetProviderProperty(): use SwapShort()/SwapLong()"
This reverts commit 62b8497999.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:40:33 -07:00
Alan Coopersmith bddafe4001 Revert "randr: ProcRRGetCrtcGamma(): use SwapShort()/SwapLong()"
This reverts commit d9863f7cb0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:38:23 -07:00
Alan Coopersmith 6a0c430b25 Revert "randr: ProcRRListOutputProperties(): use SwapShort()/SwapLong()"
This reverts commit e3001b71b3.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:38:12 -07:00
Alan Coopersmith 8650028e59 Revert "randr: ProcRRQueryOutputProperty(): use SwapShort()/SwapLong()"
This reverts commit 73467faeb2.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:37:57 -07:00
Alan Coopersmith fc7858a458 Revert "randr: RRScreenInit(): drop unnecessary zero'ing"
This reverts commit 6fad884ce7.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:36:45 -07:00