linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ppc32: Fix alignment exception checking on load/store multiple instructions
@ 2005-04-12  6:03 Kumar Gala
  2005-04-12 14:46 ` Dan Malek
  2005-04-19 14:50 ` Kumar Gala
  0 siblings, 2 replies; 8+ messages in thread
From: Kumar Gala @ 2005-04-12  6:03 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

Paulus,

Can you take a look and ack this patch before I send to akpm.

The handling of misaligned load/store multiplies did not check to see if 
the address were ok to access before __{get,put}_user().


Signed-off-by: Kumar Gala <kumar.gala@freescale.com>

---
diff -Nru a/arch/ppc/kernel/align.c b/arch/ppc/kernel/align.c
--- a/arch/ppc/kernel/align.c	2005-04-12 01:00:10 -05:00
+++ b/arch/ppc/kernel/align.c	2005-04-12 01:00:10 -05:00
@@ -290,6 +290,10 @@
 			/* 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)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-04-20  1:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-12  6:03 [PATCH] ppc32: Fix alignment exception checking on load/store multiple instructions Kumar Gala
2005-04-12 14:46 ` Dan Malek
2005-04-12 15:06   ` Kumar Gala
2005-04-12 15:26     ` Kumar Gala
2005-04-12 16:20       ` Dan Malek
2005-04-12 15:31     ` Dan Malek
2005-04-19 14:50 ` Kumar Gala
2005-04-20  1:26   ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).