]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Fix unsafe accesses to parameter area in ELFv2
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 14 Feb 2014 18:21:03 +0000 (19:21 +0100)
committerAnton Blanchard <anton@samba.org>
Wed, 23 Apr 2014 00:05:24 +0000 (10:05 +1000)
commit6cf86c5a9979ecd885f3829d4c83d25647120165
tree6ef91c1ad3c067345ce45bb6d7730ab9f38c9241
parent165c9b5ab62a4396e3c82f27652d78e2384fd2d6
powerpc: Fix unsafe accesses to parameter area in ELFv2

Some of the assembler files in lib/ make use of the fact that in the
ELFv1 ABI, the caller guarantees to provide stack space to save the
parameter registers r3 ... r10.  This guarantee is no longer present
in ELFv2 for functions that have no variable argument list and no
more than 8 arguments.

Change the affected routines to temporarily store registers in the
red zone and/or the top of their own stack frame (in the space
provided to save r31 .. r29, which is actually not used in these
routines).

In opal_query_takeover, simply always allocate a stack frame;
the routine is not performance critical.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
arch/powerpc/lib/copypage_power7.S
arch/powerpc/lib/copyuser_power7.S
arch/powerpc/lib/memcpy_64.S
arch/powerpc/lib/memcpy_power7.S
arch/powerpc/platforms/powernv/opal-takeover.S