diff options
author | Julien Thierry <julien.thierry@arm.com> | 2018-09-11 05:15:12 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2018-10-05 05:51:15 -0400 |
commit | a1d09e074250fad24f1b993f327b18cc6812eb7a (patch) | |
tree | 92904d2fbb862da96ffdfa670f7ab1556239553f /arch/arm/lib/uaccess_with_memcpy.c | |
parent | afaf6838f4bc896a711180b702b388b8cfa638fc (diff) |
ARM: 8797/1: spectre-v1.1: harden __copy_to_user
Sanitize user pointer given to __copy_to_user, both for standard version
and memcopy version of the user accessor.
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/lib/uaccess_with_memcpy.c')
-rw-r--r-- | arch/arm/lib/uaccess_with_memcpy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c index 9b4ed1728616..73dc7360cbdd 100644 --- a/arch/arm/lib/uaccess_with_memcpy.c +++ b/arch/arm/lib/uaccess_with_memcpy.c | |||
@@ -152,7 +152,8 @@ arm_copy_to_user(void __user *to, const void *from, unsigned long n) | |||
152 | n = __copy_to_user_std(to, from, n); | 152 | n = __copy_to_user_std(to, from, n); |
153 | uaccess_restore(ua_flags); | 153 | uaccess_restore(ua_flags); |
154 | } else { | 154 | } else { |
155 | n = __copy_to_user_memcpy(to, from, n); | 155 | n = __copy_to_user_memcpy(uaccess_mask_range_ptr(to, n), |
156 | from, n); | ||
156 | } | 157 | } |
157 | return n; | 158 | return n; |
158 | } | 159 | } |