From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,stable@vger.kernel.org,kees@kernel.org,broonie@kernel.org,brads@mainlining.org,bhelgaas@google.com,akpm@linux-foundation.org,drj19981414013@gmail.com
Subject: [merged mm-nonmm-stable] resource-fix-lost-wakeup-when-waiting-for-a-muxed-region.patch removed from -mm tree
Date: Tue, 06 Oct 2026 19:03:52 -0700 [thread overview]
Message-ID: <20261007020352.BE1831F0089C@smtp.kernel.org> (raw)
The quilt patch titled
Subject: resource: fix lost wakeup when waiting for a muxed region
has been removed from the -mm tree. Its filename was
resource-fix-lost-wakeup-when-waiting-for-a-muxed-region.patch
This patch was dropped because it was merged into the mm-nonmm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: DAI RENJIE <drj19981414013@gmail.com>
Subject: resource: fix lost wakeup when waiting for a muxed region
Date: Fri, 21 Aug 2026 14:08:17 +0000
A task waiting for a muxed region can sleep forever in
TASK_UNINTERRUPTIBLE even though the region it waits for is already free.
__request_region_locked() queues itself on muxed_resource_wait and drops
resource_lock before setting TASK_UNINTERRUPTIBLE, while
__release_region() wakes the queue after dropping the same lock. A wakeup
landing in between finds TASK_RUNNING, does not match TASK_NORMAL and is
discarded; callers hold a muxed region only across a bounded transaction,
so no further release is coming. The task is unkillable and its caller
never returns.
The window is one store wide, but an interrupt is enough to hold the
waiter in it, and the machine this was seen on runs PREEMPT_DYNAMIC in its
voluntary default. Since v6.11 spd5118 exports the DDR5 sensors of AMD
boards through i2c-piix4, which takes a muxed region per SMBus
transaction; a third of the in-tree users of request_muxed_region() are
hwmon drivers, so reading a world-readable attribute is all an
unprivileged user needs to drive the contention. The blocked task sleeps
holding the i2c adapter bus lock, and 27 more piled up behind it.
Reproduced by building a kernel with the two orderings selectable at
runtime and a 2ms delay inside the window. Switching only that knob, a
two-thread barriered reproducer loses the wakeup 200 times out of 200
before the fix and 0 out of 200 after it; without the delay it goes 20000
times through the wait path and loses none.
Fix it by setting the task state before dropping resource_lock, as
prepare_to_wait() does: the releasing side needs resource_lock to unlink
the resource, so it cannot reach the wakeup before the state is published.
Link: https://lore.kernel.org/20260821-b4-resource-muxed-lost-wakeup-v1-1-37eb6473a76c@gmail.com
Fixes: 8b6d043b7ee2 ("resource: shared I/O region support")
Signed-off-by: DAI RENJIE <drj19981414013@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Assisted-by: Claude:claude-opus-5
Cc: Mark Brown <broonie@kernel.org>
Cc: Kees Cook <kees@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: <stable@vger.kernel.org>
---
kernel/resource.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/resource.c~resource-fix-lost-wakeup-when-waiting-for-a-muxed-region
+++ a/kernel/resource.c
@@ -1350,8 +1350,8 @@ static int __request_region_locked(struc
}
if (conflict->flags & flags & IORESOURCE_MUXED) {
add_wait_queue(&muxed_resource_wait, &wait);
- write_unlock(&resource_lock);
set_current_state(TASK_UNINTERRUPTIBLE);
+ write_unlock(&resource_lock);
schedule();
remove_wait_queue(&muxed_resource_wait, &wait);
write_lock(&resource_lock);
_
Patches currently in -mm which might be from drj19981414013@gmail.com are
reply other threads:[~2026-10-07 2:03 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=20261007020352.BE1831F0089C@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=bhelgaas@google.com \
--cc=brads@mainlining.org \
--cc=broonie@kernel.org \
--cc=drj19981414013@gmail.com \
--cc=kees@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.