linux-stable/arch/hexagon
Arnd Bergmann a1ad747fc1 uaccess: fix integer overflow on access_ok()
commit 222ca305c9 upstream.

Three architectures check the end of a user access against the
address limit without taking a possible overflow into account.
Passing a negative length or another overflow in here returns
success when it should not.

Use the most common correct implementation here, which optimizes
for a constant 'size' argument, and turns the common case into a
single comparison.

Cc: stable@vger.kernel.org
Fixes: da55128194 ("csky: User access")
Fixes: f663b60f52 ("microblaze: Fix uaccess_ok macro")
Fixes: 7567746e1c ("Hexagon: Add user access functions")
Reported-by: David Laight <David.Laight@aculab.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-28 10:03:21 +02:00
..
configs Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00
include uaccess: fix integer overflow on access_ok() 2022-03-28 10:03:21 +02:00
kernel Merge branch 'signal-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2022-01-17 05:49:30 +02:00
lib hexagon: export raw I/O routines for modules 2021-11-20 10:35:54 -08:00
mm mm: remove redundant check about FAULT_FLAG_ALLOW_RETRY bit 2022-01-15 16:30:27 +02:00
Kbuild hexagon: move core-y in arch/hexagon/Makefile to arch/hexagon/Kbuild 2021-05-26 23:11:47 +09:00
Kconfig Tracing updates for 5.15: 2021-09-05 11:50:41 -07:00
Kconfig.debug treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile hexagon: move core-y in arch/hexagon/Makefile to arch/hexagon/Kbuild 2021-05-26 23:11:47 +09:00