]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] ppc32: Fix address checking on lmw/stmw align exception
authorPaul Mackerras <paulus@samba.org>
Sun, 1 May 2005 15:58:42 +0000 (08:58 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 1 May 2005 15:58:42 +0000 (08:58 -0700)
The handling of misaligned load/store multiple instructions did not check
to see if the address was ok to access before using __{get,put}_user().

Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc/kernel/align.c

index 40d356c66c41c0eda6846083da858efbc6bba4cc..ff81da9598d89e61455b3b6d802390c6ed83c89c 100644 (file)
@@ -290,6 +290,10 @@ fix_alignment(struct pt_regs *regs)
                        /* lwm, stmw */
                        nb = (32 - reg) * 4;
                }
+
+               if (!access_ok((flags & ST? VERIFY_WRITE: VERIFY_READ), addr, nb+nb0))
+                       return -EFAULT; /* bad address */
+
                rptr = (unsigned char *) &regs->gpr[reg];
                if (flags & LD) {
                        for (i = 0; i < nb; ++i)