summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/signal_32.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-12-20 23:59:36 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-20 23:59:36 -0800
commit5576d187a0eef3bb3c47500eaab33fb5485bc352 (patch)
tree608ac1f1091eddf17b4930d59c3a61dad7994614 /arch/powerpc/kernel/signal_32.c
parentee2fae03d68e702866a8661fbee7ff2f2f3754d7 (diff)
parent1c9bb1a01ac1bc92a0d98cf3e40a7922ee684dc0 (diff)
Merge branch 'merge' of master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc: [POWERPC] Fix register save area alignment for swapcontext syscall [POWERPC] Fix PCI device channel state initialization [POWERPC] Update MTD OF documentation [POWERPC] Probe Efika platform before CHRP. [POWERPC] Fix build of cell zImage.initrd [POWERPC] iSeries: fix CONFIG_VIOPATH dependency [POWERPC] iSeries: fix viocons init [POWERPC] iSeries: fix viocd init [POWERPC] iSeries: fix iseries_veth init [POWERPC] iSeries: fix viotape init [POWERPC] iSeries: fix viodasd init [POWERPC] Workaround oldworld OF bug with IRQs & P2P bridges [POWERPC] powerpc: add scanning of ebc bus to of_platform [POWERPC] spufs: fix assignment of node numbers [POWERPC] cell: Fix spufs with "new style" device-tree [POWERPC] cell: Enable spider workarounds on all PCI buses [POWERPC] cell: add forward struct declarations to spu.h [POWERPC] cell: update cell_defconfig
Diffstat (limited to 'arch/powerpc/kernel/signal_32.c')
-rw-r--r--arch/powerpc/kernel/signal_32.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index e4ebe1a6228..6b405a3f43f 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -835,11 +835,21 @@ long sys_swapcontext(struct ucontext __user *old_ctx,
return -EINVAL;
if (old_ctx != NULL) {
+ struct mcontext __user *mctx;
+
+ /*
+ * old_ctx might not be 16-byte aligned, in which
+ * case old_ctx->uc_mcontext won't be either.
+ * Because we have the old_ctx->uc_pad2 field
+ * before old_ctx->uc_mcontext, we need to round down
+ * from &old_ctx->uc_mcontext to a 16-byte boundary.
+ */
+ mctx = (struct mcontext __user *)
+ ((unsigned long) &old_ctx->uc_mcontext & ~0xfUL);
if (!access_ok(VERIFY_WRITE, old_ctx, sizeof(*old_ctx))
- || save_user_regs(regs, &old_ctx->uc_mcontext, 0)
+ || save_user_regs(regs, mctx, 0)
|| put_sigset_t(&old_ctx->uc_sigmask, &current->blocked)
- || __put_user(to_user_ptr(&old_ctx->uc_mcontext),
- &old_ctx->uc_regs))
+ || __put_user(to_user_ptr(mctx), &old_ctx->uc_regs))
return -EFAULT;
}
if (new_ctx == NULL)