Skip to content

[ciqlts9_2] Multiple patches tested (2 commits)#1423

Open
ciq-kernel-automation[bot] wants to merge 2 commits into
ciqlts9_2from
{roxanan}_ciqlts9_2
Open

[ciqlts9_2] Multiple patches tested (2 commits)#1423
ciq-kernel-automation[bot] wants to merge 2 commits into
ciqlts9_2from
{roxanan}_ciqlts9_2

Conversation

@ciq-kernel-automation

@ciq-kernel-automation ciq-kernel-automation Bot commented Jul 9, 2026

Copy link
Copy Markdown

Summary

This PR has been automatically created after successful completion of all CI stages.

Commit Message(s)

rtmutex: Use waiter::task instead of current in remove_waiter()

jira VULN-191595
cve CVE-2026-43499
commit-author Keenan Dong <keenanat2000@gmail.com>
commit 3bfdc63936dd4773109b7b8c280c0f3b5ae7d349
upstream-diff |
	Used the 5.15.y submission to stable that replaces the scoped_guard()
	macro with raw spinlock operations.
locking/rtmutex: Skip remove_waiter() when waiter is not enqueued

jira VULN-190208
cve CVE-2026-53163
commit-author Davidlohr Bueso <dave@stgolabs.net>
commit 40a25d59e85b3c8709ac2424d44f65610467871e
upstream-diff |
	Adjusted context due to missing scoped_guard and in
	rt_mutex_start_proxy_lock due to missing commit 894d1b3db41c
	("locking/mutex: Remove wakeups from under mutex::wait_lock")

Testing

Ghostlock

LTS 9.2 without the fix

[rnicolescu@localhost CVE-2026-43499]$ ./a.out
CVE-2026-43499 trigger
[M] deadlock chain: W→futex2(O)→cycle_futex(W)→W
[M] firing FUTEX_CMP_REQUEUE_PI
[M] FUTEX_CMP_REQUEUE_PI = -1  errno=35 (Resource deadlock avoided)
[M] EDEADLK: W→pi_blocked_on is stale — waiting for W timeout
[W] FUTEX_WAIT_RE[ Q U E26.4U63E60_6] PBIUG:  kernrel eturnNULL pointer dereference, address: 0000000000000001
[   26.464256] #PF: supervisor read access in kernel mode
ed[  - 1  2 6e.r4r6n4o5=11409] #PF: error_code(0x0000) - not-present page
[   26.464882] PGD 110602067 P4D 110602067 PUD 110601067 PMD 0
[   26 .(4C6o5n2n1e4c]t iOono ptsi:m 0000 [#1] PREEMPT SMP NOPTI
[   26.465539] CPU: 1 PID: 1527 Comm: a.out Kdump: loaded Not tainted 5.14.0-284.11.1.el9_2.x86_64 #1
4d[   o u2t6).
 6[6M0]5 0U]A FHardware name: Red Hat KVM/RHEL, BIOS 1.16.3-7.el10 04/01/2014
[   26.466495] RIP: 0010:raw_spin_trylock+0xc/0x40
[   26.466777] Code: 41 5c c3 cc cc cc cc 89 c6 e8 40 dc 62 ff 66 90 4c 89 e0 41 5c c3 cc cc cc cc 0f 1f 40 00 0f 1f 44 00 00 65 ff 05 04 18 4e 59 <8b> 07 85 c0 75 10 ba 01 00 00 00 f0 0f b1 17 b8 01 00 00 00 74 10
[   26.467837] RSP: 0018:ffffac4540647ba8 EFLAGS: 00010082
[   26.468140] RAX: 0000000000000078 RBX: ffffac4540647d18 RCX: 00000000ffff9d26
[   26.468548] RDX: 0000000000000001 RSI: 0000000000000400 RDI: 0000000000000001
[   26.468957] RBP: ffff9d1ed19e1cc0 R08: ffffac4540647d18 R09: ffff9d1ed173d640
[   26.469363] R10: ffff9d1ec5908af8 R11: 0000000000000002 R12: ffff9d1ed19e2a5c
[   26.469771] R13: ffffac4540647d18 R14: 0000000000000001 R15: ffffac45408dbd20
[   26.470182] FS:  00007f3c3d83b740(0000) GS:ffff9d261fa40000(0000) knlGS:0000000000000000
[   26.470643] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   26.470979] CR2: 0000000000000001 CR3: 0000000102f34006 CR4: 0000000000770ee0
[   26.471387] PKRU: 55555554
[   26.471547] Call Trace:
[   26.471694]  <TASK>
[   26.471822]  rt_mutex_adjust_prio_chain+0x68/0x8c0
[   26.472106]  task_blocks_on_rt_mutex.constprop.0+0x1d3/0x3d0
[   26.472434]  ? futex_lock_pi_atomic+0x191/0x430
[   26.472701]  __rt_mutex_start_proxy_lock+0x47/0x70
[   26.472986]  futex_lock_pi+0x241/0x450
[   26.473206]  do_futex+0xd1/0x200
[   26.473402]  __x64_sys_futex+0x73/0x1d0
 p[r o b e2:6 .F4U7T3E6X6_4LO]  do_syscall_64+0x59/0x90
CK[ P I (2c6y.c4l7e4_4f6u5t]e  ? vfs_write+0x178/0x280
[   26.475253]  ? vfs_write+0x178/0x280
[)
    26.475875]  ? syscall_exit_work+0x11a/0x150
[   26.476646]  ? syscall_exit_to_user_mode+0x12/0x30
[   26.477455]  ? do_syscall_64+0x69/0x90
[   26.478098]  ? sysvec_apic_timer_interrupt+0x3c/0x90
[   26.478958]  entry_SYSCALL_64_after_hwframe+0x63/0xcd
[   26.479813] RIP: 0033:0x7f3c3d708ccd
[   26.480428] Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1b 21 0f 00 f7 d8 64 89 01 48
[   26.483501] RSP: 002b:00007ffc21417a08 EFLAGS: 00000216 ORIG_RAX: 00000000000000ca
[   26.484641] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f3c3d708ccd
[   26.485242] RDX: 0000000000000000 RSI: 0000000000000086 RDI: 0000000000404080
[   26.485660] RBP: 00007ffc21417a50 R08: 0000000000000000 R09: 0000000000000000
[   26.486077] R10: 0000000000000000 R11: 0000000000000216 R12: 00007ffc21417b98
[   26.486493] R13: 00000000004014b2 R14: 0000000000403e08 R15: 00007f3c3d881000
[   26.486908]  </TASK>
[   26.487046] Modules linked in: rfkill vfat fat intel_rapl_msr intel_rapl_common intel_pmc_core kvm_intel kvm irqbypass rapl iTCO_wdt iTCO_vendor_support virtio_gpu virtio_dma_buf i2c_i801 drm_shmem_helper i2c_smbus pcspkr drm_kms_helper lpc_ich virtio_balloon syscopyarea sysfillrect sysimgblt fb_sys_fops joydev drm xfs libcrc32c sr_mod cdrom sg virtiofs ahci libahci fuse crct10dif_pclmul virtio_net crc32_pclmul libata net_failover crc32c_intel failover virtio_blk virtio_console ghash_clmulni_intel serio_raw sunrpc dm_mirror dm_region_hash dm_log dm_mod
[   26.489821] CR2: 0000000000000001
LTS 9.2 fixed

[rnicolescu@localhost CVE-2026-43499]$ ./a.out
CVE-2026-43499 trigger
[M] deadlock chain: W→futex2(O)→cycle_futex(W)→W
[M] firing FUTEX_CMP_REQUEUE_PI
[M] FUTEX_CMP_REQUEUE_PI = -1 errno=35 (Resource deadlock avoided)
[M] EDEADLK: W→pi_blocked_on is stale — waiting for W timeout
[W] FUTEX_WAIT_REQUEUE_PI returned -1 errno=110 (Connection timed out)
[M] UAF probe: FUTEX_LOCK_PI(cycle_futex)
[M] UAF probe returned

Test Results

✅ Build Stage

Architecture Build Time Total Time
x86_64 18m 9s 18m 51s
aarch64 12m 38s 13m 12s

✅ Boot Verification

✅ Kernel Selftests

Architecture Passed Failed Compared Against Status
x86_64 174 24 ciqlts9_2 ✅ No regressions
aarch64 141 27 ciqlts9_2 ✅ No regressions

✅ LTP Results

Architecture Passed Failed Compared Against Status
x86_64 1439 81 ciqlts9_2 ✅ No regressions
aarch64 1409 83 ciqlts9_2 ✅ No regressions

🤖 This PR was automatically generated by GitHub Actions
Run ID: 29070600136

@ciq-kernel-automation ciq-kernel-automation Bot added the created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI) label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/29047468334

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🔍 Upstream Linux Kernel Commit Check

  • ⚠️ PR commit 337d3077208 (locking: Introduce __cleanup() based infrastructure) references upstream commit
    54da6a092431 which has been referenced by a Fixes: tag in the upstream
    Linux kernel:
    cd7eb8f83fc mm/slab: make __free(kfree) accept error pointers (Dan Carpenter) (CVE-2024-36890)
  • ⚠️ PR commit e78344ba931 (eventpoll: don't decrement ep refcount while still holding the ep mutex) does not reference a CVE but
    upstream commit 8c2e52ebbe88 is associated with CVE-2025-38349

  • ⚠️ PR commit 9d21a959f5e (rtmutex: Use waiter::task instead of current in remove_waiter()) references upstream commit
    3bfdc63936dd which has been referenced by a Fixes: tag in the upstream
    Linux kernel:

    74e144274af futex/requeue: Prevent NULL pointer dereference in remove_waiter() on self-deadlock (Ji'an Zhou) (CVE-2026-53166)

This is an automated message from the kernel commit checker workflow.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🔍 Interdiff Analysis

  • ⚠️ PR commit c1656112476 (epoll: use refcount to reduce ep_mutex contention) → upstream 58c9b016e128
    Differences found:
################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -771,6 +809,8 @@
 	call_rcu(&epi->rcu, epi_rcu_free);
 
 	percpu_counter_dec(&ep->user->epoll_watches);
+	return ep_refcount_dec_and_test(ep);
+}
 
 	return 0;
 }

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -723,6 +732,6 @@
 	call_rcu(&epi->rcu, epi_rcu_free);
 
-	atomic_long_dec(&ep->user->epoll_watches);
+	percpu_counter_dec(&ep->user->epoll_watches);
 
 	return 0;
 }
@@ -735,7 +744,7 @@
 
 	/* We need to release all tasks waiting for these file */
 	if (waitqueue_active(&ep->poll_wait))
-		ep_poll_safewake(ep, NULL);
+		ep_poll_safewake(ep, NULL, 0);
 
 	/*
 	 * We need to lock this because we could be hit by
  • ⚠️ PR commit 337d3077208 (locking: Introduce __cleanup() based infrastructure) → upstream 54da6a092431
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -66,5 +66,5 @@
  */
-#define __cold                          __attribute__((__cold__))
+#define __assume_aligned(a, ...)        __attribute__((__assume_aligned__(a, ## __VA_ARGS__)))
 
 /*
  * Note the long name.
--- b/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -124,5 +124,5 @@
-extern void __percpu *__alloc_percpu_gfp(size_t size, size_t align, gfp_t gfp);
-extern void __percpu *__alloc_percpu(size_t size, size_t align);
+extern void __percpu *__alloc_percpu_gfp(size_t size, size_t align, gfp_t gfp) __alloc_size(1);
+extern void __percpu *__alloc_percpu(size_t size, size_t align) __alloc_size(1);
 extern void free_percpu(void __percpu *__pdata);
 extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
 
--- b/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -29,4 +29,4 @@
 #include <linux/lockdep.h>
 #include <asm/processor.h>
 #include <linux/cpumask.h>
-
+#include <linux/context_tracking_irq.h>

================================================================================
*    ONLY IN PATCH2 - files not modified by patch1                             *
================================================================================

--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -8,6 +8,7 @@
  */
 
 #include <linux/linkage.h>
+#include <linux/cleanup.h>
 #include <linux/list.h>
 
 /*
@@ -463,4 +464,8 @@ static __always_inline void preempt_enable_nested(void)
 		preempt_enable();
 }
 
+DEFINE_LOCK_GUARD_0(preempt, preempt_disable(), preempt_enable())
+DEFINE_LOCK_GUARD_0(preempt_notrace, preempt_disable_notrace(), preempt_enable_notrace())
+DEFINE_LOCK_GUARD_0(migrate, migrate_disable(), migrate_enable())
+
 #endif /* __LINUX_PREEMPT_H */
  • ⚠️ PR commit a1f8a6cde0f (file: add fput() cleanup helper) → upstream 257b1c2c78c2
    Differences found:
================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/include/linux/file.h
+++ b/include/linux/file.h
@@ -92,6 +92,6 @@
 
 DEFINE_CLASS(get_unused_fd, int, if (_T >= 0) put_unused_fd(_T),
 	     get_unused_fd_flags(flags), unsigned flags)
 
-extern void fd_install(unsigned int fd, struct file *file);
-
+/*
+ * take_fd() will take care to set @fd to -EBADF ensuring that
  • ⚠️ PR commit e78344ba931 (eventpoll: don't decrement ep refcount while still holding the ep mutex) → upstream 8c2e52ebbe88
    Differences found:
################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -828,7 +828,7 @@
 	kfree_rcu(epi, rcu);
 
 	percpu_counter_dec(&ep->user->epoll_watches);
-	return ep_refcount_dec_and_test(ep);
+	return true;
 }
 
 /*

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -760,5 +761,5 @@
 
-	atomic_long_dec(&ep->user->epoll_watches);
+	percpu_counter_dec(&ep->user->epoll_watches);
 	return ep_refcount_dec_and_test(ep);
 }
  • ⚠️ PR commit 99dd29e429d (eventpoll: move epi_fget() up) → upstream 86e87059e6d1
    Differences found:
================================================================================
*    DELTA DIFFERENCES - code changes that differ between the patches          *
================================================================================

--- b/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -724,7 +724,7 @@
 	struct file *file;
 
 	file = epi->ffd.file;
-	if (!atomic_long_inc_not_zero(&file->f_count))
+	if (!file_ref_get(&file->f_ref))
 		file = NULL;
 	return file;
 }

################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1046,34 +1074,6 @@
 	return res;
 }
 
-/*
- * The ffd.file pointer may be in the process of being torn down due to
- * being closed, but we may not have finished eventpoll_release() yet.
- *
- * Normally, even with the atomic_long_inc_not_zero, the file may have
- * been free'd and then gotten re-allocated to something else (since
- * files are not RCU-delayed, they are SLAB_TYPESAFE_BY_RCU).
- *
- * But for epoll, users hold the ep->mtx mutex, and as such any file in
- * the process of being free'd will block in eventpoll_release_file()
- * and thus the underlying file allocation will not be free'd, and the
- * file re-use cannot happen.
- *
- * For the same reason we can avoid a rcu_read_lock() around the
- * operation - 'ffd.file' cannot go away even if the refcount has
- * reached zero (but we must still not call out to ->poll() functions
- * etc).
- */
-static struct file *epi_fget(const struct epitem *epi)
-{
-	struct file *file;
-
-	file = epi->ffd.file;
-	if (!file_ref_get(&file->f_ref))
-		file = NULL;
-	return file;
-}
-
 /*
  * Differs from ep_eventpoll_poll() in that internal callers already have
  * the ep->mtx so we need to start from depth=1, such that mutex_lock_nested()
  • ⚠️ PR commit 9d21a959f5e (rtmutex: Use waiter::task instead of current in remove_waiter()) → upstream 3bfdc63936dd
    Differences found:
================================================================================
*    DELTA DIFFERENCES - code changes that differ between the patches          *
================================================================================

--- b/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1487,10 +1487,10 @@
 
 	lockdep_assert_held(&lock->wait_lock);
 
-	raw_spin_lock(&waiter_task->pi_lock);
-	rt_mutex_dequeue(lock, waiter);
-	waiter_task->pi_blocked_on = NULL;
-	raw_spin_unlock(&waiter_task->pi_lock);
+	scoped_guard(raw_spinlock, &waiter_task->pi_lock) {
+		rt_mutex_dequeue(lock, waiter);
+		waiter_task->pi_blocked_on = NULL;
+	}
 
 	/*
 	 * Only update priority if the waiter was the highest priority
  • ⚠️ PR commit 32f302f8e48 (locking/rtmutex: Skip remove_waiter() when waiter is not enqueued) → upstream 40a25d59e85b
    Differences found:
################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1558,6 +1558,9 @@
 
 	lockdep_assert_held(&lock->wait_lock);
 
+	if (!waiter_task) /* never enqueued */
+		return;
+
 	scoped_guard(raw_spinlock, &waiter_task->pi_lock) {
 		rt_mutex_dequeue(lock, waiter);
 		waiter_task->pi_blocked_on = NULL;
--- b/kernel/locking/rtmutex_api.c
+++ b/kernel/locking/rtmutex_api.c
@@ -365,7 +365,7 @@
 
 	raw_spin_lock_irq(&lock->wait_lock);
 	ret = __rt_mutex_start_proxy_lock(lock, waiter, task, &wake_q);
-	if (unlikely(ret))
+	if (unlikely(ret < 0))
 		remove_waiter(lock, waiter);
 	preempt_disable();
 	raw_spin_unlock_irq(&lock->wait_lock);

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1484,6 +1484,6 @@
 
 	lockdep_assert_held(&lock->wait_lock);
 
-	raw_spin_lock(&waiter_task->pi_lock);
-	rt_mutex_dequeue(lock, waiter);
-	waiter_task->pi_blocked_on = NULL;
+	scoped_guard(raw_spinlock, &waiter_task->pi_lock) {
+		rt_mutex_dequeue(lock, waiter);
+		waiter_task->pi_blocked_on = NULL;
--- b/kernel/locking/rtmutex_api.c
+++ b/kernel/locking/rtmutex_api.c
@@ -342,5 +342,6 @@
 	raw_spin_lock_irq(&lock->wait_lock);
-	ret = __rt_mutex_start_proxy_lock(lock, waiter, task);
+	ret = __rt_mutex_start_proxy_lock(lock, waiter, task, &wake_q);
 	if (unlikely(ret))
 		remove_waiter(lock, waiter);
+	preempt_disable();
 	raw_spin_unlock_irq(&lock->wait_lock);

This is an automated interdiff check for backported commits.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

JIRA PR Check Results

1 commit(s) with issues found:

Commit 32f302f8e481

Summary: locking/rtmutex: Skip remove_waiter() when waiter is not enqueued

⚠️ Warnings:

  • VULN-190208: No time logged - please log time manually

Summary: Checked 16 commit(s) total.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/29047468334

@kerneltoast kerneltoast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NACK: This PR introduces the commit that causes the epoll vulnerabilities, and adds the subsequent fixes for them. The source of the epoll vulnerabilities is epoll: use refcount to reduce ep_mutex contention.

Niebelungen-D and others added 2 commits July 9, 2026 21:55
jira VULN-191595
cve CVE-2026-43499
commit-author Keenan Dong <keenanat2000@gmail.com>
commit 3bfdc63
upstream-diff |
	Used the 5.15.y submission to stable that replaces the scoped_guard()
	macro with raw spinlock operations.

remove_waiter() is used by the slowlock paths, but it is also used for
proxy-lock rollback in rt_mutex_start_proxy_lock() when invoked from
futex_requeue().

In the latter case waiter::task is not current, but remove_waiter()
operates on current for the dequeue operation. That results in several
problems:

  1) the rbtree dequeue happens without waiter::task::pi_lock being held

  2) the waiter task's pi_blocked_on state is not cleared, which leaves a
     dangling pointer primed for UAF around.

  3) rt_mutex_adjust_prio_chain() operates on the wrong top priority waiter
     task

Use waiter::task instead of current in all related operations in
remove_waiter() to cure those problems.

[ tglx: Fixup rt_mutex_adjust_prio_chain(), add a comment and amend the
  	changelog ]

[ sidk: Replace scoped_guard() macro with raw spinlock operations for
	5.15]

Fixes: 8161239 ("rtmutex: Simplify PI algorithm and make highest prio task get lock")
	Reported-by: Yuan Tan <yuantan098@gmail.com>
	Reported-by: Yifan Wu <yifanwucs@gmail.com>
	Reported-by: Juefei Pu <tomapufckgml@gmail.com>
	Reported-by: Xin Liu <bird@lzu.edu.cn>
	Signed-off-by: Keenan Dong <keenanat2000@gmail.com>
	Signed-off-by: Thomas Gleixner <tglx@kernel.org>
	Cc: stable@vger.kernel.org
(cherry picked from commit 3bfdc63)
	Signed-off-by: Sid Kumar <sidkumar1@gmail.com>
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-190208
cve CVE-2026-53163
commit-author Davidlohr Bueso <dave@stgolabs.net>
commit 40a25d5
upstream-diff |
	Adjusted context due to missing scoped_guard and in
	rt_mutex_start_proxy_lock due to missing commit 894d1b3
	("locking/mutex: Remove wakeups from under mutex::wait_lock")

syzbot triggered the following splat in remove_waiter() via
FUTEX_CMP_REQUEUE_PI:

  KASAN: null-ptr-deref in range [0x0000000000000a88-0x0000000000000a8f]
   class_raw_spinlock_constructor
   remove_waiter+0x159/0x1200 kernel/locking/rtmutex.c:1561
   rt_mutex_start_proxy_lock+0x103/0x120
   futex_requeue+0x10e4/0x20d0
   __x64_sys_futex+0x34f/0x4d0

task_blocks_on_rt_mutex() does not arm the waiter upon deadlock detection,
leaving waiter->task nil, where 3bfdc63 ("rtmutex: Use waiter::task instead
of current in remove_waiter()") made this fatal.

Furthermore, rt_mutex_start_proxy_lock() should not be calling into remove_waiter()
upon a successfully grabbing the rtmutex. 1a1fb98 ("futex: Handle early deadlock
return correctly"), moved the remove_waiter() out of __rt_mutex_start_proxy_lock()
(where 'ret' was only ever 0 or < 0) into the wrapper. Tighten this check to
account for try_to_take_rt_mutex().

Fixes: 3bfdc63 ("rtmutex: Use waiter::task instead of current in remove_waiter()")
	Reported-by: syzbot+78147abe6c524f183ee9@syzkaller.appspotmail.com
	Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
	Signed-off-by: Thomas Gleixner <tglx@kernel.org>
	Cc: stable@vger.kernel.org
Closes: https://lore.kernel.org/all/69f114ac.050a0220.ac8b.0003.GAE@google.com/
Link: https://patch.msgid.link/20260507112913.1019537-1-dave@stgolabs.net
(cherry picked from commit 40a25d5)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
@kerneltoast kerneltoast force-pushed the {roxanan}_ciqlts9_2 branch from 32f302f to 2c61617 Compare July 10, 2026 04:56
@github-actions

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/29070491310

@github-actions

Copy link
Copy Markdown

🔍 Upstream Linux Kernel Commit Check

  • ⚠️ PR commit 86046e82a97 (rtmutex: Use waiter::task instead of current in remove_waiter()) references upstream commit
    3bfdc63936dd which has been referenced by a Fixes: tag in the upstream
    Linux kernel:
    74e144274af futex/requeue: Prevent NULL pointer dereference in remove_waiter() on self-deadlock (Ji'an Zhou) (CVE-2026-53166)

This is an automated message from the kernel commit checker workflow.

@github-actions

Copy link
Copy Markdown

🔍 Interdiff Analysis

  • ⚠️ PR commit 86046e82a97 (rtmutex: Use waiter::task instead of current in remove_waiter()) → upstream 3bfdc63936dd
    Differences found:
================================================================================
*    DELTA DIFFERENCES - code changes that differ between the patches          *
================================================================================

--- b/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1487,10 +1487,10 @@
 
 	lockdep_assert_held(&lock->wait_lock);
 
-	raw_spin_lock(&waiter_task->pi_lock);
-	rt_mutex_dequeue(lock, waiter);
-	waiter_task->pi_blocked_on = NULL;
-	raw_spin_unlock(&waiter_task->pi_lock);
+	scoped_guard(raw_spinlock, &waiter_task->pi_lock) {
+		rt_mutex_dequeue(lock, waiter);
+		waiter_task->pi_blocked_on = NULL;
+	}
 
 	/*
 	 * Only update priority if the waiter was the highest priority
  • ⚠️ PR commit 2c6161793f5 (locking/rtmutex: Skip remove_waiter() when waiter is not enqueued) → upstream 40a25d59e85b
    Differences found:
################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1558,6 +1558,9 @@
 
 	lockdep_assert_held(&lock->wait_lock);
 
+	if (!waiter_task) /* never enqueued */
+		return;
+
 	scoped_guard(raw_spinlock, &waiter_task->pi_lock) {
 		rt_mutex_dequeue(lock, waiter);
 		waiter_task->pi_blocked_on = NULL;
--- b/kernel/locking/rtmutex_api.c
+++ b/kernel/locking/rtmutex_api.c
@@ -365,7 +365,7 @@
 
 	raw_spin_lock_irq(&lock->wait_lock);
 	ret = __rt_mutex_start_proxy_lock(lock, waiter, task, &wake_q);
-	if (unlikely(ret))
+	if (unlikely(ret < 0))
 		remove_waiter(lock, waiter);
 	preempt_disable();
 	raw_spin_unlock_irq(&lock->wait_lock);

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1484,6 +1484,6 @@
 
 	lockdep_assert_held(&lock->wait_lock);
 
-	raw_spin_lock(&waiter_task->pi_lock);
-	rt_mutex_dequeue(lock, waiter);
-	waiter_task->pi_blocked_on = NULL;
+	scoped_guard(raw_spinlock, &waiter_task->pi_lock) {
+		rt_mutex_dequeue(lock, waiter);
+		waiter_task->pi_blocked_on = NULL;
--- b/kernel/locking/rtmutex_api.c
+++ b/kernel/locking/rtmutex_api.c
@@ -342,5 +342,6 @@
 	raw_spin_lock_irq(&lock->wait_lock);
-	ret = __rt_mutex_start_proxy_lock(lock, waiter, task);
+	ret = __rt_mutex_start_proxy_lock(lock, waiter, task, &wake_q);
 	if (unlikely(ret))
 		remove_waiter(lock, waiter);
+	preempt_disable();
 	raw_spin_unlock_irq(&lock->wait_lock);

This is an automated interdiff check for backported commits.

@github-actions

Copy link
Copy Markdown

JIRA PR Check Results

1 commit(s) with issues found:

Commit 2c6161793f51

Summary: locking/rtmutex: Skip remove_waiter() when waiter is not enqueued

⚠️ Warnings:

  • VULN-190208: No time logged - please log time manually

Summary: Checked 2 commit(s) total.

@github-actions

Copy link
Copy Markdown

Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/29070491310

@kerneltoast kerneltoast force-pushed the {roxanan}_ciqlts9_2 branch from 2c61617 to 9a39986 Compare July 10, 2026 05:05
@github-actions

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/29070854604

@github-actions

Copy link
Copy Markdown

🔍 Upstream Linux Kernel Commit Check

  • ⚠️ PR commit 98e0f54d370 (rtmutex: Use waiter::task instead of current in remove_waiter()) references upstream commit
    3bfdc63936dd which has been referenced by a Fixes: tag in the upstream
    Linux kernel:
    74e144274af futex/requeue: Prevent NULL pointer dereference in remove_waiter() on self-deadlock (Ji'an Zhou) (CVE-2026-53166)

This is an automated message from the kernel commit checker workflow.

@github-actions

Copy link
Copy Markdown

🔍 Interdiff Analysis

  • ⚠️ PR commit 98e0f54d370 (rtmutex: Use waiter::task instead of current in remove_waiter()) → upstream 3bfdc63936dd
    Differences found:
================================================================================
*    DELTA DIFFERENCES - code changes that differ between the patches          *
================================================================================

--- b/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1487,10 +1487,10 @@
 
 	lockdep_assert_held(&lock->wait_lock);
 
-	raw_spin_lock(&waiter_task->pi_lock);
-	rt_mutex_dequeue(lock, waiter);
-	waiter_task->pi_blocked_on = NULL;
-	raw_spin_unlock(&waiter_task->pi_lock);
+	scoped_guard(raw_spinlock, &waiter_task->pi_lock) {
+		rt_mutex_dequeue(lock, waiter);
+		waiter_task->pi_blocked_on = NULL;
+	}
 
 	/*
 	 * Only update priority if the waiter was the highest priority
  • ⚠️ PR commit 9a39986349c (locking/rtmutex: Skip remove_waiter() when waiter is not enqueued) → upstream 40a25d59e85b
    Differences found:
################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1558,6 +1558,9 @@
 
 	lockdep_assert_held(&lock->wait_lock);
 
+	if (!waiter_task) /* never enqueued */
+		return;
+
 	scoped_guard(raw_spinlock, &waiter_task->pi_lock) {
 		rt_mutex_dequeue(lock, waiter);
 		waiter_task->pi_blocked_on = NULL;
--- b/kernel/locking/rtmutex_api.c
+++ b/kernel/locking/rtmutex_api.c
@@ -365,7 +365,7 @@
 
 	raw_spin_lock_irq(&lock->wait_lock);
 	ret = __rt_mutex_start_proxy_lock(lock, waiter, task, &wake_q);
-	if (unlikely(ret))
+	if (unlikely(ret < 0))
 		remove_waiter(lock, waiter);
 	preempt_disable();
 	raw_spin_unlock_irq(&lock->wait_lock);

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1484,6 +1484,6 @@
 
 	lockdep_assert_held(&lock->wait_lock);
 
-	raw_spin_lock(&waiter_task->pi_lock);
-	rt_mutex_dequeue(lock, waiter);
-	waiter_task->pi_blocked_on = NULL;
+	scoped_guard(raw_spinlock, &waiter_task->pi_lock) {
+		rt_mutex_dequeue(lock, waiter);
+		waiter_task->pi_blocked_on = NULL;
--- b/kernel/locking/rtmutex_api.c
+++ b/kernel/locking/rtmutex_api.c
@@ -342,5 +342,6 @@
 	raw_spin_lock_irq(&lock->wait_lock);
-	ret = __rt_mutex_start_proxy_lock(lock, waiter, task);
+	ret = __rt_mutex_start_proxy_lock(lock, waiter, task, &wake_q);
 	if (unlikely(ret))
 		remove_waiter(lock, waiter);
+	preempt_disable();
 	raw_spin_unlock_irq(&lock->wait_lock);

This is an automated interdiff check for backported commits.

@github-actions

Copy link
Copy Markdown

JIRA PR Check Results

2 commit(s) with issues found:

Commit 9a39986349c7

Summary: locking/rtmutex: Skip remove_waiter() when waiter is not enqueued

⚠️ Warnings:

  • VULN-190208: No time logged - please log time manually

Commit 98e0f54d3703

Summary: rtmutex: Use waiter::task instead of current in remove_waiter()

❌ Errors:

  • VULN-191595: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-191595: No time logged - please log time manually

Summary: Checked 2 commit(s) total.

@github-actions

Copy link
Copy Markdown

Validation checks completed with issues View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/29070854604

@kerneltoast kerneltoast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the epoll commits since 9.2 is in fact not affected. Now looks good to me. :shipit:

@ciq-kernel-automation ciq-kernel-automation Bot changed the title [ciqlts9_2] Multiple patches tested (16 commits) [ciqlts9_2] Multiple patches tested (2 commits) Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI)

Development

Successfully merging this pull request may close these issues.

3 participants