-
由 Christophe Leroy 提交于
stable inclusion from linux-4.19.129 commit e18590b3e242638e873a61d299abf8a9df446236 -------------------------------- commit ab10ae1c 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: 594cc251 ("make 'user_access_begin()' do 'access_ok()'") Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org> Signed-off-by: NMiles Chen <miles.chen@mediatek.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
48ed5580