diff options
| author | Archana Polampalli <archana.polampalli@windriver.com> | 2025-07-02 21:16:18 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-07-09 08:43:32 -0700 |
| commit | b4ccec2a44013926d5e7d8553afbfb17192946bc (patch) | |
| tree | a9fdbb0913bc3cbf8def69b8a5520d174f7c0b6c | |
| parent | 65e08ee344401b3faa97f3a127b6bac0b377915e (diff) | |
| download | poky-b4ccec2a44013926d5e7d8553afbfb17192946bc.tar.gz | |
xwayland: fix CVE-2025-49179
A flaw was found in the X Record extension. The RecordSanityCheckRegisterClients
function does not check for an integer overflow when computing request length,
which allows a client to bypass length checks.
(From OE-Core rev: de28bff9b54b2725d8c06c4760e0ed2b59d3fa61)
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/recipes-graphics/xwayland/xwayland/CVE-2025-49179.patch | 69 | ||||
| -rw-r--r-- | meta/recipes-graphics/xwayland/xwayland_23.2.5.bb | 1 |
2 files changed, 70 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xwayland/xwayland/CVE-2025-49179.patch b/meta/recipes-graphics/xwayland/xwayland/CVE-2025-49179.patch new file mode 100644 index 0000000000..48c7ed8c13 --- /dev/null +++ b/meta/recipes-graphics/xwayland/xwayland/CVE-2025-49179.patch | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | From 9d205323894af62b9726fcbaeb5fc69b3c9f61ba Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Olivier Fourdan <ofourdan@redhat.com> | ||
| 3 | Date: Mon, 28 Apr 2025 11:47:15 +0200 | ||
| 4 | Subject: [PATCH] record: Check for overflow in | ||
| 5 | RecordSanityCheckRegisterClients() | ||
| 6 | |||
| 7 | The RecordSanityCheckRegisterClients() checks for the request length, | ||
| 8 | but does not check for integer overflow. | ||
| 9 | |||
| 10 | A client might send a very large value for either the number of clients | ||
| 11 | or the number of protocol ranges that will cause an integer overflow in | ||
| 12 | the request length computation, defeating the check for request length. | ||
| 13 | |||
| 14 | To avoid the issue, explicitly check the number of clients against the | ||
| 15 | limit of clients (which is much lower than an maximum integer value) and | ||
| 16 | the number of protocol ranges (multiplied by the record length) do not | ||
| 17 | exceed the maximum integer value. | ||
| 18 | |||
| 19 | This way, we ensure that the final computation for the request length | ||
| 20 | will not overflow the maximum integer limit. | ||
| 21 | |||
| 22 | CVE-2025-49179 | ||
| 23 | |||
| 24 | This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and | ||
| 25 | reported by Julian Suleder via ERNW Vulnerability Disclosure. | ||
| 26 | |||
| 27 | Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> | ||
| 28 | Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 29 | (cherry picked from commit 2bde9ca49a8fd9a1e6697d5e7ef837870d66f5d4) | ||
| 30 | |||
| 31 | Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2026> | ||
| 32 | |||
| 33 | CVE: CVE-2025-49179 | ||
| 34 | |||
| 35 | Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/9d205323894af62b9726fcbaeb5fc69b3c9f61ba] | ||
| 36 | |||
| 37 | Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> | ||
| 38 | --- | ||
| 39 | record/record.c | 8 ++++++++ | ||
| 40 | 1 file changed, 8 insertions(+) | ||
| 41 | |||
| 42 | diff --git a/record/record.c b/record/record.c | ||
| 43 | index e123867..018e53f 100644 | ||
| 44 | --- a/record/record.c | ||
| 45 | +++ b/record/record.c | ||
| 46 | @@ -45,6 +45,7 @@ and Jim Haggerty of Metheus. | ||
| 47 | #include "inputstr.h" | ||
| 48 | #include "eventconvert.h" | ||
| 49 | #include "scrnintstr.h" | ||
| 50 | +#include "opaque.h" | ||
| 51 | |||
| 52 | #include <stdio.h> | ||
| 53 | #include <assert.h> | ||
| 54 | @@ -1298,6 +1299,13 @@ RecordSanityCheckRegisterClients(RecordContextPtr pContext, ClientPtr client, | ||
| 55 | int i; | ||
| 56 | XID recordingClient; | ||
| 57 | |||
| 58 | + /* LimitClients is 2048 at max, way less that MAXINT */ | ||
| 59 | + if (stuff->nClients > LimitClients) | ||
| 60 | + return BadValue; | ||
| 61 | + | ||
| 62 | + if (stuff->nRanges > (MAXINT - 4 * stuff->nClients) / SIZEOF(xRecordRange)) | ||
| 63 | + return BadValue; | ||
| 64 | + | ||
| 65 | if (((client->req_len << 2) - SIZEOF(xRecordRegisterClientsReq)) != | ||
| 66 | 4 * stuff->nClients + SIZEOF(xRecordRange) * stuff->nRanges) | ||
| 67 | return BadLength; | ||
| 68 | -- | ||
| 69 | 2.40.0 | ||
diff --git a/meta/recipes-graphics/xwayland/xwayland_23.2.5.bb b/meta/recipes-graphics/xwayland/xwayland_23.2.5.bb index e150961882..490e1ca05f 100644 --- a/meta/recipes-graphics/xwayland/xwayland_23.2.5.bb +++ b/meta/recipes-graphics/xwayland/xwayland_23.2.5.bb | |||
| @@ -29,6 +29,7 @@ SRC_URI = "https://www.x.org/archive/individual/xserver/xwayland-${PV}.tar.xz \ | |||
| 29 | file://CVE-2025-49176-0002.patch \ | 29 | file://CVE-2025-49176-0002.patch \ |
| 30 | file://CVE-2025-49177.patch \ | 30 | file://CVE-2025-49177.patch \ |
| 31 | file://CVE-2025-49178.patch \ | 31 | file://CVE-2025-49178.patch \ |
| 32 | file://CVE-2025-49179.patch \ | ||
| 32 | " | 33 | " |
| 33 | SRC_URI[sha256sum] = "33ec7ff2687a59faaa52b9b09aa8caf118e7ecb6aed8953f526a625ff9f4bd90" | 34 | SRC_URI[sha256sum] = "33ec7ff2687a59faaa52b9b09aa8caf118e7ecb6aed8953f526a625ff9f4bd90" |
| 34 | 35 | ||
