linux/arch/hexagon
Arnd Bergmann e65d28d4e9 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 09:58:45 +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 09:58:45 +02:00
kernel hexagon: clean up timer-regs.h 2021-11-25 09:48:42 +01:00
lib hexagon: export raw I/O routines for modules 2021-11-25 09:48:42 +01:00
mm hexagon: use generic strncpy/strnlen from_user 2021-07-23 14:40:00 +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