diff --git a/backport-CVE-2022-46340.patch b/backport-0001-CVE-2022-46340.patch similarity index 100% rename from backport-CVE-2022-46340.patch rename to backport-0001-CVE-2022-46340.patch diff --git a/backport-0002-CVE-2022-46340.patch b/backport-0002-CVE-2022-46340.patch new file mode 100644 index 0000000000000000000000000000000000000000..b227688b7a55f0ca01e92ddd15dd7407ebfababc --- /dev/null +++ b/backport-0002-CVE-2022-46340.patch @@ -0,0 +1,34 @@ +From bb1711b7fba42f2a0c7d1c09beee241a1b2bcc30 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 19 Dec 2022 10:06:45 +1000 +Subject: [PATCH] Xext: fix invalid event type mask in XTestSwapFakeInput + +In commit b320ca0 the mask was inadvertently changed from octal 0177 to +hexadecimal 0x177. + +Fixes commit b320ca0ffe4c0c872eeb3a93d9bde21f765c7c63 + Xtest: disallow GenericEvents in XTestSwapFakeInput + +Found by Stuart Cassoff + +Signed-off-by: Peter Hutterer +--- + Xext/xtest.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Xext/xtest.c b/Xext/xtest.c +index 2985a4ce6..dde5c4cf9 100644 +--- a/Xext/xtest.c ++++ b/Xext/xtest.c +@@ -502,7 +502,7 @@ XTestSwapFakeInput(ClientPtr client, xReq * req) + + nev = ((req->length << 2) - sizeof(xReq)) / sizeof(xEvent); + for (ev = (xEvent *) &req[1]; --nev >= 0; ev++) { +- int evtype = ev->u.u.type & 0x177; ++ int evtype = ev->u.u.type & 0177; + /* Swap event */ + proc = EventSwapVector[evtype]; + /* no swapping proc; invalid event type? */ +-- +GitLab + diff --git a/backport-Xi-return-an-error-from-XI-property-changes-if-verification-failed.patch b/backport-Xi-return-an-error-from-XI-property-changes-if-verification-failed.patch new file mode 100644 index 0000000000000000000000000000000000000000..e4f203a0459e906364576104d70ff935d90a0de8 --- /dev/null +++ b/backport-Xi-return-an-error-from-XI-property-changes-if-verification-failed.patch @@ -0,0 +1,41 @@ +From b8a84cb0f2807b07ab70ca9915fcdee21301b8ca Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 29 Nov 2022 13:24:00 +1000 +Subject: [PATCH] Xi: return an error from XI property changes if verification + failed + +Both ProcXChangeDeviceProperty and ProcXIChangeProperty checked the +property for validity but didn't actually return the potential error. + +Signed-off-by: Peter Hutterer +Acked-by: Olivier Fourdan +--- + Xi/xiproperty.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c +index a36f7d61d..68c362c62 100644 +--- a/Xi/xiproperty.c ++++ b/Xi/xiproperty.c +@@ -902,6 +902,8 @@ ProcXChangeDeviceProperty(ClientPtr client) + + rc = check_change_property(client, stuff->property, stuff->type, + stuff->format, stuff->mode, stuff->nUnits); ++ if (rc != Success) ++ return rc; + + len = stuff->nUnits; + if (len > (bytes_to_int32(0xffffffff - sizeof(xChangeDevicePropertyReq)))) +@@ -1141,6 +1143,9 @@ ProcXIChangeProperty(ClientPtr client) + + rc = check_change_property(client, stuff->property, stuff->type, + stuff->format, stuff->mode, stuff->num_items); ++ if (rc != Success) ++ return rc; ++ + len = stuff->num_items; + if (len > bytes_to_int32(0xffffffff - sizeof(xXIChangePropertyReq))) + return BadLength; +-- +GitLab + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 430c06ab1d7c0c689ab5c64bf4b4012c384e4aca..d20334eab505ffccaabf5d6a31009d74d8f40286 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -16,7 +16,7 @@ Name: xorg-x11-server Version: 1.20.11 -Release: 14 +Release: 15 Summary: X.Org X11 X server License: MIT and GPLv2 URL: https://www.x.org @@ -94,12 +94,14 @@ Patch6008: backport-CVE-2022-3551.patch Patch6009: xorg-server-1.20.11-sw.patch %endif Patch6010: backport-CVE-2022-3553.patch -Patch6011: backport-CVE-2022-4283.patch -Patch6012: backport-CVE-2022-46340.patch +Patch6011: backport-0001-CVE-2022-46340.patch +Patch6012: backport-0002-CVE-2022-46340.patch Patch6013: backport-CVE-2022-46341.patch Patch6014: backport-CVE-2022-46342.patch Patch6015: backport-CVE-2022-46343.patch -Patch6016: backport-CVE-2022-46344.patch +Patch6016: backport-Xi-return-an-error-from-XI-property-changes-if-verification-failed.patch +Patch6017: backport-CVE-2022-46344.patch +Patch6018: backport-CVE-2022-4283.patch BuildRequires: audit-libs-devel autoconf automake bison dbus-devel flex git gcc BuildRequires: systemtap-sdt-devel libtool pkgconfig @@ -443,6 +445,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %{_mandir}/man*/* %changelog +* Tue Jan 10 2023 zhouwenpei -1.20.11-15 +- add missing patches + * Thu Dec 22 2022 wanglin - 1.20.11-14 - Fix openEuler hard code problem - use -git instead of .git as the filename, to avoid .git ignore