]> git.karo-electronics.de Git - mv-sheeva.git/commit
m68k: Fix stack mangling logics in sigreturn
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 6 Oct 2010 18:09:43 +0000 (14:09 -0400)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Fri, 7 Jan 2011 13:01:35 +0000 (14:01 +0100)
commitea52b58ccbda49aeb23eb424ce05bba3cb0bc976
tree82455ff39095652a80a09457428cf1ed937b71c9
parent90731d7537317ad5d9672187f7a1dff90b29bb12
m68k: Fix stack mangling logics in sigreturn

a) we should hold modifying regs->format until we know we *will* be
doing stack expansion; otherwise attacker can modify sigframe to
have wrong ->sc_formatvec and install SIGSEGV handler.

b) we should *not* mix copying saved extra stuff from userland with
expanding the stack; once we'd done that manual memmove, we'd better
not return to C, so cleanup is very hard to do.  The easiest way
is to copy it on stack first, making sure we won't overwrite on stack
expansion.  Fortunately that's easy to do...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/kernel/signal.c