ARM: 8051/1: put_user: fix possible data corruption in put_user
authorAndrey Ryabinin <a.ryabinin@samsung.com>
Wed, 7 May 2014 07:07:25 +0000 (08:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jun 2014 18:54:09 +0000 (11:54 -0700)
commit8d8d73b3e5af5849c64cfc85d55a9d5eadde9049
tree9aadf3261d127a74612fa38126b1fb7ff36bc170
parent2a279573c2d33d9a2f7d88f0ae2d9f3f4370ddd6
ARM: 8051/1: put_user: fix possible data corruption in put_user

commit 537094b64b229bf3ad146042f83e74cf6abe59df upstream.

According to arm procedure call standart r2 register is call-cloberred.
So after the result of x expression was put into r2 any following
function call in p may overwrite r2. To fix this, the result of p
expression must be saved to the temporary variable before the
assigment x expression to __r2.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/include/asm/uaccess.h