From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,stable@vger.kernel.org,
manfred@colorfullife.com,dave@stgolabs.net,akpm@linux-foundation.org,
songhh06101@gmail.com
Subject: [merged mm-nonmm-hotfixes-stable] ipc-msg-serialize-receive-permission-checks-with-ipc_set.patch removed from -mm tree
Date: Tue, 01 Dec 2026 19:50:59 -0800 [thread overview]
Message-ID: <20261202035059.B0AFD1F000C1@smtp.kernel.org> (raw)
The quilt patch titled
Subject: ipc/msg: serialize receive permission checks with IPC_SET
has been removed from the -mm tree. Its filename was
ipc-msg-serialize-receive-permission-checks-with-ipc_set.patch
This patch was dropped because it was merged into the mm-nonmm-hotfixes-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Hyunho Song <songhh06101@gmail.com>
Subject: ipc/msg: serialize receive permission checks with IPC_SET
Date: Sun, 22 Nov 2026 18:37:35 -0800
do_msgrcv() checks read permission before taking the queue lock. IPC_SET
can revoke access after that check and before the receiver joins
q_receivers. It then misses the IPC_SET wakeup and can receive a later
message despite losing access.
Take the queue lock before the receive loop so the permission check,
message lookup and insertion into q_receivers are serialized with IPC_SET.
The receiver releases the lock before sleeping. On an -EAGAIN wakeup it
reacquires the lock, removes itself from q_receivers, and keeps the lock
for the next permission check. The earlier revision [1] unlocked at the
bottom of the loop only to lock again at the top.
Signed-off-by: Hyunho Song <songhh06101@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Hyunho Song <songhh06101@gmail.com>
Suggested-by: Manfred Spraul <manfred@colorfullife.com>
Reviewed-by: Manfred Spraul <manfred@colorfullife.com>
Tested-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: <stable@vger.kernel.org>
ipc/msg.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
--- a/ipc/msg.c~ipc-msg-serialize-receive-permission-checks-with-ipc_set
+++ a/ipc/msg.c
@@ -1132,14 +1132,13 @@ static long do_msgrcv(int msqid, void __
return PTR_ERR(msq);
}
+ ipc_lock_object(&msq->q_perm);
for (;;) {
struct msg_receiver msr_d;
msg = ERR_PTR(-EACCES);
if (ipcperms(ns, &msq->q_perm, S_IRUGO))
- goto out_unlock1;
-
- ipc_lock_object(&msq->q_perm);
+ goto out_unlock0;
/* raced with RMID? */
if (!ipc_valid_object(&msq->q_perm)) {
@@ -1248,8 +1247,6 @@ static long do_msgrcv(int msqid, void __
msg = ERR_PTR(-ERESTARTNOHAND);
goto out_unlock0;
}
-
- ipc_unlock_object(&msq->q_perm);
}
out_unlock0:
_
Patches currently in -mm which might be from songhh06101@gmail.com are
reply other threads:[~2026-12-02 3:50 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=20261202035059.B0AFD1F000C1@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=manfred@colorfullife.com \
--cc=mm-commits@vger.kernel.org \
--cc=songhh06101@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox