linux-stable/arch/microblaze
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
..
boot microblaze: timer: Remove unused properties 2021-10-26 07:37:18 +02:00
configs microblaze: Remove noMMU code 2020-11-26 16:39:35 +01: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 microblaze: use generic strncpy/strnlen from_user 2021-07-27 23:01:13 +02:00
mm mm: remove redundant check about FAULT_FLAG_ALLOW_RETRY bit 2022-01-15 16:30:27 +02:00
pci PCI: Rename pcibios_add_device() to pcibios_device_add() 2021-09-21 15:26:09 -05:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Kconfig.platform docs: kbuild: convert docs to ReST and rename to *.rst 2019-06-14 14:21:21 -06:00
Makefile microblaze: use built-in function to get CPU_{MAJOR,MINOR,REV} 2022-01-08 18:28:21 +09:00