[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <176347611584.498.1344690421091616025.tip-bot2@tip-bot2>
Date: Tue, 18 Nov 2025 14:28:35 -0000
From: "tip-bot2 for Christophe Leroy" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Christophe Leroy <christophe.leroy@...roup.eu>,
Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: core/uaccess] lib/strn*,uaccess: Use
masked_user_{read/write}_access_begin when required
The following commit has been merged into the core/uaccess branch of tip:
Commit-ID: 4322c8f81c58da493a3c46eda32f0e7534a350a0
Gitweb: https://git.kernel.org/tip/4322c8f81c58da493a3c46eda32f0e7534a350a0
Author: Christophe Leroy <christophe.leroy@...roup.eu>
AuthorDate: Mon, 17 Nov 2025 17:43:44 +01:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Tue, 18 Nov 2025 15:27:35 +01:00
lib/strn*,uaccess: Use masked_user_{read/write}_access_begin when required
Properly use masked_user_read_access_begin() and
masked_user_write_access_begin() instead of masked_user_access_begin() in
order to match user_read_access_end() and user_write_access_end(). This is
important for architectures like PowerPC that enable separately user reads
and user writes.
That means masked_user_read_access_begin() is used when user memory is
exclusively read during the window and masked_user_write_access_begin()
is used when user memory is exclusively writen during the window.
masked_user_access_begin() remains and is used when both reads and
writes are performed during the open window. Each of them is expected
to be terminated by the matching user_read_access_end(),
user_write_access_end() and user_access_end().
Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Link: https://patch.msgid.link/cb5e4b0fa49ea9c740570949d5e3544423389757.1763396724.git.christophe.leroy@csgroup.eu
---
lib/strncpy_from_user.c | 2 +-
lib/strnlen_user.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/strncpy_from_user.c b/lib/strncpy_from_user.c
index 6dc2349..5bb752f 100644
--- a/lib/strncpy_from_user.c
+++ b/lib/strncpy_from_user.c
@@ -126,7 +126,7 @@ long strncpy_from_user(char *dst, const char __user *src, long count)
if (can_do_masked_user_access()) {
long retval;
- src = masked_user_access_begin(src);
+ src = masked_user_read_access_begin(src);
retval = do_strncpy_from_user(dst, src, count, count);
user_read_access_end();
return retval;
diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c
index 6e489f9..4a6574b 100644
--- a/lib/strnlen_user.c
+++ b/lib/strnlen_user.c
@@ -99,7 +99,7 @@ long strnlen_user(const char __user *str, long count)
if (can_do_masked_user_access()) {
long retval;
- str = masked_user_access_begin(str);
+ str = masked_user_read_access_begin(str);
retval = do_strnlen_user(str, count, count);
user_read_access_end();
return retval;
Powered by blists - more mailing lists