Skip to content
Commit 222ca305 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

uaccess: fix integer overflow on access_ok()

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: da551281 ("csky: User access")
Fixes: f663b60f ("microblaze: Fix uaccess_ok macro")
Fixes: 7567746e

 ("Hexagon: Add user access functions")
Reported-by: default avatarDavid Laight <David.Laight@aculab.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent dfd42fac
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment