提交 d5812a77 编写于 作者: P Paul Mackerras 提交者: Linus Torvalds

[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: NKumar Gala <kumar.gala@freescale.com>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 b20cc8af
...@@ -290,6 +290,10 @@ fix_alignment(struct pt_regs *regs) ...@@ -290,6 +290,10 @@ fix_alignment(struct pt_regs *regs)
/* lwm, stmw */ /* lwm, stmw */
nb = (32 - reg) * 4; 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]; rptr = (unsigned char *) &regs->gpr[reg];
if (flags & LD) { if (flags & LD) {
for (i = 0; i < nb; ++i) for (i = 0; i < nb; ++i)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册