Commit d5812a77 authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds
Browse files

[PATCH] ppc32: Fix address checking on lmw/stmw align exception



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: default avatarKumar Gala <kumar.gala@freescale.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b20cc8af
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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)