]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
7.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jul 2026 12:04:05 +0000 (14:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jul 2026 12:04:05 +0000 (14:04 +0200)
added patches:
futex-requeue-revert-prevent-null-pointer-dereference-in-remove_waiter-on-self-deadlock.patch

queue-7.1/futex-requeue-revert-prevent-null-pointer-dereference-in-remove_waiter-on-self-deadlock.patch [new file with mode: 0644]
queue-7.1/series

diff --git a/queue-7.1/futex-requeue-revert-prevent-null-pointer-dereference-in-remove_waiter-on-self-deadlock.patch b/queue-7.1/futex-requeue-revert-prevent-null-pointer-dereference-in-remove_waiter-on-self-deadlock.patch
new file mode 100644 (file)
index 0000000..d49d2c3
--- /dev/null
@@ -0,0 +1,50 @@
+From 39def6d250d370298f86c116f4ac60093cefadaa Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Wed, 1 Jul 2026 15:11:50 +0200
+Subject: futex/requeue: Revert "Prevent NULL pointer dereference in remove_waiter() on self-deadlock""
+
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+commit 39def6d250d370298f86c116f4ac60093cefadaa upstream.
+
+The commit cited below should not have been merged. It attemted to fix an
+existing problem ansd thereby introduced new problems by keeping the
+pi_state in state Q_REQUEUE_PI_IN_PROGRESS and leaking it.
+
+Based on the commit description the intention was to handle the case
+when task_blocks_on_rt_mutex() returns -EDEADLK and the following
+remove_waiter() dereferences the NULL pointer in waiter->task.
+
+That is already handled by Davidlohr in commit 40a25d59e85b3
+("locking/rtmutex: Skip remove_waiter() when waiter is not enqueued") and
+requires no further acting.
+
+Revert the commit breaking the "waiter == owner" case again.
+
+Fixes: 74e144274af39 ("futex/requeue: Prevent NULL pointer dereference in remove_waiter() on self-deadlock")
+Reported-by: Michael Bommarito <michael.bommarito@gmail.com>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Signed-off-by: Thomas Gleixner <tglx@kernel.org>
+Cc: stable@vger.kernel.org
+Link: https://patch.msgid.link/20260701131150.0Ijhq4Dw@linutronix.de
+Closes: https://lore.kernel.org/all/20260629020049.2082397-1-michael.bommarito@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/futex/requeue.c |    6 ------
+ 1 file changed, 6 deletions(-)
+
+--- a/kernel/futex/requeue.c
++++ b/kernel/futex/requeue.c
+@@ -643,12 +643,6 @@ retry_private:
+                               continue;
+                       }
+-                      /* Self-deadlock: non-top waiter already owns the PI futex. */
+-                      if (rt_mutex_owner(&pi_state->pi_mutex) == this->task) {
+-                              ret = -EDEADLK;
+-                              break;
+-                      }
+-
+                       ret = rt_mutex_start_proxy_lock(&pi_state->pi_mutex,
+                                                       this->rt_waiter,
+                                                       this->task);
index 382bd00b8d918fbc706a6b2d69bd3021378b3cf1..d34f661f8eef526653fbc29ac4cbf711265e1632 100644 (file)
@@ -19,3 +19,4 @@ rust-pci-use-static-lifetime-for-pci-bar-resource-names.patch
 rust-block-fix-gendisk-cleanup-paths.patch
 rust-doctest-fix-incorrect-pattern-in-replacement.patch
 rust-kbuild-set-frame-pointer-llvm-module-flag-for-config_frame_pointer.patch
+futex-requeue-revert-prevent-null-pointer-dereference-in-remove_waiter-on-self-deadlock.patch