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)
committerJiri Slaby <jslaby@suse.cz>
Fri, 20 Jun 2014 15:33:59 +0000 (17:33 +0200)
commitadd232a1a6031431736e0c774cb8e1e7fe89db60
tree545a07b3f21d8b03d6ec2976666bc0d48cadf593
parent7e84ef36ae2501e1155e9011ead7e59aadd0910d
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: Jiri Slaby <jslaby@suse.cz>
arch/arm/include/asm/uaccess.h