]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ARM: 7527/1: uaccess: explicitly check __user pointer when !CPU_USE_DOMAINS
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 7 Sep 2012 17:22:28 +0000 (18:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Oct 2012 17:38:59 +0000 (10:38 -0700)
commit7951bef55a24041c91377ee67ad06a361aea42d0
tree3c2b32ea1e09985f9888888d56f201f393844d79
parentc11bc85ae982aba3e1cb85a7e9ff6c4a53d5ea2c
ARM: 7527/1: uaccess: explicitly check __user pointer when !CPU_USE_DOMAINS

commit 8404663f81d212918ff85f493649a7991209fa04 upstream.

The {get,put}_user macros don't perform range checking on the provided
__user address when !CPU_HAS_DOMAINS.

This patch reworks the out-of-line assembly accessors to check the user
address against a specified limit, returning -EFAULT if is is out of
range.

[will: changed get_user register allocation to match put_user]
[rmk: fixed building on older ARM architectures]

Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/include/asm/assembler.h
arch/arm/include/asm/uaccess.h
arch/arm/lib/getuser.S
arch/arm/lib/putuser.S