summaryrefslogtreecommitdiffstats
path: root/mm/usercopy.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-08-21 13:35:16 +0200
committerLinus Walleij <linus.walleij@linaro.org>2019-08-21 13:35:16 +0200
commit880e4f93f94677dff02f795352ed4f069ee046b7 (patch)
tree339be7ef0256eb6586180f014a8bd8f2f3e7fa72 /mm/usercopy.c
parent19d17d935b29f30510874fd34e93357eea0daba2 (diff)
parentd1abaeb3be7b5fa6d7a1fbbd2e14e3310005c4c1 (diff)
downloadlinux-stable-880e4f93f94677dff02f795352ed4f069ee046b7.tar.gz
linux-stable-880e4f93f94677dff02f795352ed4f069ee046b7.tar.bz2
linux-stable-880e4f93f94677dff02f795352ed4f069ee046b7.zip
Merge tag 'v5.3-rc5' into devel
Linux 5.3-rc5
Diffstat (limited to 'mm/usercopy.c')
-rw-r--r--mm/usercopy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/usercopy.c b/mm/usercopy.c
index 2a09796edef8..98e924864554 100644
--- a/mm/usercopy.c
+++ b/mm/usercopy.c
@@ -147,7 +147,7 @@ static inline void check_bogus_address(const unsigned long ptr, unsigned long n,
bool to_user)
{
/* Reject if object wraps past end of memory. */
- if (ptr + n < ptr)
+ if (ptr + (n - 1) < ptr)
usercopy_abort("wrapped address", NULL, to_user, 0, ptr + n);
/* Reject if NULL or ZERO-allocation. */