aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/strncpy_from_user.c
diff options
context:
space:
mode:
authorNick Terrell <terrelln@fb.com>2022-10-21 16:00:35 -0700
committerNick Terrell <terrelln@fb.com>2022-10-21 16:00:35 -0700
commit14e77332e74603efab8347c89d3cda447c3b97c9 (patch)
treeb7b8a48f4f75590266a763c52e072dda32b228ae /lib/strncpy_from_user.c
parentlib: zstd: clean up double word in comment. (diff)
parentMerge tag 'for-linus-6.1-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip (diff)
downloadwireguard-linux-14e77332e74603efab8347c89d3cda447c3b97c9.tar.xz
wireguard-linux-14e77332e74603efab8347c89d3cda447c3b97c9.zip
Merge branch 'main' into zstd-next
Diffstat (limited to 'lib/strncpy_from_user.c')
-rw-r--r--lib/strncpy_from_user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/strncpy_from_user.c b/lib/strncpy_from_user.c
index 122d8d0e253c..6432b8c3e431 100644
--- a/lib/strncpy_from_user.c
+++ b/lib/strncpy_from_user.c
@@ -25,7 +25,7 @@
* hit it), 'max' is the address space maximum (and we return
* -EFAULT if we hit it).
*/
-static inline long do_strncpy_from_user(char *dst, const char __user *src,
+static __always_inline long do_strncpy_from_user(char *dst, const char __user *src,
unsigned long count, unsigned long max)
{
const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
@@ -120,7 +120,7 @@ long strncpy_from_user(char *dst, const char __user *src, long count)
if (unlikely(count <= 0))
return 0;
- max_addr = user_addr_max();
+ max_addr = TASK_SIZE_MAX;
src_addr = (unsigned long)untagged_addr(src);
if (likely(src_addr < max_addr)) {
unsigned long max = max_addr - src_addr;