linux-stable/arch/hexagon/include
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
..
asm uaccess: fix integer overflow on access_ok() 2022-03-28 09:58:45 +02:00
uapi/asm hexagon: remove asm/bitsperlong.h 2019-11-11 20:07:02 +09:00