public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Olivier Fourdan <ofourdan@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/xorg-x11-server-Xwayland] f43: Backport a couple of fixups from upstream
Date: Tue, 27 Oct 2026 13:46:49 GMT	[thread overview]
Message-ID: <179310880963.1.13498592706772956417.rpms-xorg-x11-server-Xwayland-1aa8f976d07f@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/xorg-x11-server-Xwayland
Branch : f43
Commit : 1aa8f976d07fab943c0536ab9f3aaa6758a81513
Author : Olivier Fourdan <ofourdan@redhat.com>
Date   : 2026-10-27T14:11:47+01:00
Stats  : +109/-1 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/xorg-x11-server-Xwayland/c/1aa8f976d07fab943c0536ab9f3aaa6758a81513?branch=f43

Log:
Backport a couple of fixups from upstream

---
diff --git a/0001-Xi-avoid-memory-leak-when-hitting-bounds-check-for-b.patch b/0001-Xi-avoid-memory-leak-when-hitting-bounds-check-for-b.patch
new file mode 100644
index 0000000..2c4d402
--- /dev/null
+++ b/0001-Xi-avoid-memory-leak-when-hitting-bounds-check-for-b.patch
@@ -0,0 +1,42 @@
+From 59ae14238143dc41a05b5eb399028b167a4a9582 Mon Sep 17 00:00:00 2001
+From: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu, 8 Oct 2026 17:17:20 -0700
+Subject: [PATCH xserver 1/2] Xi: avoid memory leak when hitting bounds check
+ for barrier events
+
+The fix for CVE-2026-93519 added a bounds check for barrier events in
+CreatePointerBarrierClient() and if it's hit immediately returns
+BadAlloc.  Unfortunately it was added after `ret` was already allocated
+and before *client_out is set to `ret`, so `ret` leaks.
+
+This fix changes it to jump to the same cleanup code to free(ret)
+that the rest of the function already uses.
+
+Fixes: 1f42cc1f0 ("Xi: add bounds check for barrier events in input_constrain_cursor")
+Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2352>
+(cherry picked from commit 8e901e6013803a94b25020bde384dd17966564eb)
+---
+ Xi/xibarriers.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
+index aad8db752..8cfc67555 100644
+--- a/Xi/xibarriers.c
++++ b/Xi/xibarriers.c
+@@ -602,8 +602,10 @@ CreatePointerBarrierClient(ClientPtr client,
+      * function */
+     xorg_list_for_each_entry(counter, &cs->barriers, entry) {
+         nbarriers++;
+-        if (nbarriers >= 32)
+-            return BadAlloc;
++        if (nbarriers >= 32) {
++            err = BadAlloc;
++            goto error;
++        }
+     }
+ 
+     ret->screen = screen;
+-- 
+2.56.0
+

diff --git a/0002-Xi-fix-event_id-time-delta-in-generated-barrier-even.patch b/0002-Xi-fix-event_id-time-delta-in-generated-barrier-even.patch
new file mode 100644
index 0000000..f61208c
--- /dev/null
+++ b/0002-Xi-fix-event_id-time-delta-in-generated-barrier-even.patch
@@ -0,0 +1,60 @@
+From 4623c9680b1332add519ff5b1736f16f57d45233 Mon Sep 17 00:00:00 2001
+From: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu, 8 Oct 2026 17:53:59 -0700
+Subject: [PATCH xserver 2/2] Xi: fix event_id & time delta in generated
+ barrier events
+
+The fix for CVE-2026-93519 moved the updates of pbd->last_timestamp
+and pbd->barrier_event_id from after they were used to generate the
+data in events to before, causing the event_id to be one too high,
+and the time delta (ms - pbd->last_timestamp) to always be zero.
+
+This fix moves them back to being after they are used to generate
+the event data.
+
+Fixes: 1f42cc1f ("Xi: add bounds check for barrier events in input_constrain_cursor")
+Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2353>
+(cherry picked from commit 98aed9ddba7b42d2a46fcc1f343f4b392967b838)
+---
+ Xi/xibarriers.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
+index 8cfc67555..52bc6ecc8 100644
+--- a/Xi/xibarriers.c
++++ b/Xi/xibarriers.c
+@@ -417,7 +417,7 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
+     DeviceIntPtr master;
+ 
+     /* We cannot know how many events are available in *events, but
+-     * we know it all DDX very protbably allocated them with
++     * we know that all DDX very probably allocated them with
+      * GetMaximumEventsNum() and fill_pointer_events() may have added one.
+      *
+      * Let's cap at a maximum of 64 barrier events which is way more than
+@@ -517,10 +517,6 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
+             continue;
+ 
+         pbd->hit = FALSE;
+-        pbd->last_timestamp = ms;
+-        /* If we've left the hit box, this is the
+-         * start of a new event ID. */
+-        pbd->barrier_event_id++;
+ 
+         if (*nevents < MAX_BARRIER_EVENTS) {
+             ev.type = ET_BarrierLeave;
+@@ -542,6 +538,10 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
+             *nevents += 1;
+         }
+ 
++        pbd->last_timestamp = ms;
++        /* If we've left the hit box, this is the
++         * start of a new event ID. */
++        pbd->barrier_event_id++;
+     }
+ 
+  out:
+-- 
+2.56.0
+

diff --git a/xorg-x11-server-Xwayland.spec b/xorg-x11-server-Xwayland.spec
index de1d33b..eb26d27 100644
--- a/xorg-x11-server-Xwayland.spec
+++ b/xorg-x11-server-Xwayland.spec
@@ -9,7 +9,7 @@
 Summary:   Xwayland
 Name:      xorg-x11-server-Xwayland
 Version:   24.1.14
-Release:   1%{?gitdate:.%{gitdate}git%{shortcommit}}%{?dist}
+Release:   2%{?gitdate:.%{gitdate}git%{shortcommit}}%{?dist}
 
 URL:       http://www.x.org
 %if 0%{?gitdate}
@@ -18,6 +18,9 @@ Source0:   https://gitlab.freedesktop.org/xorg/%{pkgname}/-/archive/%{commit}/%{
 Source0:   https://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.xz
 %endif
 
+Patch:     0001-Xi-avoid-memory-leak-when-hitting-bounds-check-for-b.patch
+Patch:     0002-Xi-fix-event_id-time-delta-in-generated-barrier-even.patch
+
 License:   MIT
 
 Requires: xkeyboard-config
@@ -133,6 +136,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
 %{_libdir}/pkgconfig/xwayland.pc
 
 %changelog
+* Tue Oct 27 2026 Olivier Fourdan <ofourdan@redhat.com> - 24.1.14-2
+- Backport a couple of fixups from upstream
+
 * Wed Oct 07 2026 Olivier Fourdan <ofourdan@redhat.com> - 24.1.14-1
 - Update to xwayland 24.1.14
   CVE fix for: CVE-2026-88812, CVE-2026-93515, CVE-2026-93516

                 reply	other threads:[~2026-10-27 13:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179310880963.1.13498592706772956417.rpms-xorg-x11-server-Xwayland-1aa8f976d07f@fedoraproject.org \
    --to=ofourdan@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox