]> rtime.felk.cvut.cz Git - linux-imx.git/commit
ARM: 6489/1: thumb2: fix incorrect optimisation in usracc
authorWill Deacon <will.deacon@arm.com>
Fri, 19 Nov 2010 12:18:31 +0000 (13:18 +0100)
committerAndi Kleen <ak@linux.intel.com>
Tue, 14 Dec 2010 22:40:15 +0000 (23:40 +0100)
commita683346b0f0625d3b29194fa86082235d1e858ce
tree3ebdcbfa8d6ac3180de94ce6f20c2727585cc4d4
parentc088a5f8722f305b4bbaa94cad32f1bfa882bc71
ARM: 6489/1: thumb2: fix incorrect optimisation in usracc

commit 1142b71d85894dcff1466dd6c871ea3c89e0352c upstream.

Commit 8b592783 added a Thumb-2 variant of usracc which, when it is
called with \rept=2, calls usraccoff once with an offset of 0 and
secondly with a hard-coded offset of 4 in order to avoid incrementing
the pointer again. If \inc != 4 then we will store the data to the wrong
offset from \ptr. Luckily, the only caller that passes \rept=2 to this
function is __clear_user so we haven't been actively corrupting user data.

This patch fixes usracc to pass \inc instead of #4 to usraccoff
when it is called a second time.

Reported-by: Tony Thompson <tony.thompson@arm.com>
Acked-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@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
arch/arm/include/asm/assembler.h