Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@csgroup.eu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://patch.msgid.link/cb5e4b0fa49ea9c740570949d5e3544423389757.1763396724.git.christophe.leroy@csgroup.eu

authored by

Christophe Leroy and committed by
Thomas Gleixner
4322c8f8 1c204914

+2 -2
+1 -1
lib/strncpy_from_user.c
··· 126 126 if (can_do_masked_user_access()) { 127 127 long retval; 128 128 129 - src = masked_user_access_begin(src); 129 + src = masked_user_read_access_begin(src); 130 130 retval = do_strncpy_from_user(dst, src, count, count); 131 131 user_read_access_end(); 132 132 return retval;
+1 -1
lib/strnlen_user.c
··· 99 99 if (can_do_masked_user_access()) { 100 100 long retval; 101 101 102 - str = masked_user_access_begin(str); 102 + str = masked_user_read_access_begin(str); 103 103 retval = do_strnlen_user(str, count, count); 104 104 user_read_access_end(); 105 105 return retval;