diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2020-01-23 11:34:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-22 10:04:59 +0300 |
commit | e18590b3e242638e873a61d299abf8a9df446236 (patch) | |
tree | 70cbd8aa14c9104c19f9931362d57ee920b559ba /lib/ucs2_string.c | |
parent | b46395f443d61ec34cd9e42d05cae1eebbd4c31a (diff) | |
download | linux-e18590b3e242638e873a61d299abf8a9df446236.tar.xz |
lib: Reduce user_access_begin() boundaries in strncpy_from_user() and strnlen_user()
commit ab10ae1c3bef56c29bac61e1201c752221b87b41 upstream.
The range passed to user_access_begin() by strncpy_from_user() and
strnlen_user() starts at 'src' and goes up to the limit of userspace
although reads will be limited by the 'count' param.
On 32 bits powerpc (book3s/32) access has to be granted for each
256Mbytes segment and the cost increases with the number of segments to
unlock.
Limit the range with 'count' param.
Fixes: 594cc251fdd0 ("make 'user_access_begin()' do 'access_ok()'")
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/ucs2_string.c')
0 files changed, 0 insertions, 0 deletions