diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-20 08:59:45 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-20 08:59:45 -0400 |
commit | d59bf96cdde5b874a57bfd1425faa45da915d0b7 (patch) | |
tree | 351a40b72514d620e5bebea2de38c26f23277ffc /arch/powerpc/kernel | |
parent | 28df955a2ad484d602314b30183ea8496a9aa34a (diff) | |
parent | 25f42b6af09e34c3f92107b36b5aa6edc2fdba2f (diff) |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/prom_init.c | 10 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_32.c | 11 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_64.c | 2 |
3 files changed, 22 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 41e9ab40cd54..f70bd090dacd 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -822,6 +822,7 @@ static void __init prom_send_capabilities(void) | |||
822 | /* try calling the ibm,client-architecture-support method */ | 822 | /* try calling the ibm,client-architecture-support method */ |
823 | if (call_prom_ret("call-method", 3, 2, &ret, | 823 | if (call_prom_ret("call-method", 3, 2, &ret, |
824 | ADDR("ibm,client-architecture-support"), | 824 | ADDR("ibm,client-architecture-support"), |
825 | root, | ||
825 | ADDR(ibm_architecture_vec)) == 0) { | 826 | ADDR(ibm_architecture_vec)) == 0) { |
826 | /* the call exists... */ | 827 | /* the call exists... */ |
827 | if (ret) | 828 | if (ret) |
@@ -1622,6 +1623,15 @@ static int __init prom_find_machine_type(void) | |||
1622 | if (strstr(p, RELOC("Power Macintosh")) || | 1623 | if (strstr(p, RELOC("Power Macintosh")) || |
1623 | strstr(p, RELOC("MacRISC"))) | 1624 | strstr(p, RELOC("MacRISC"))) |
1624 | return PLATFORM_POWERMAC; | 1625 | return PLATFORM_POWERMAC; |
1626 | #ifdef CONFIG_PPC64 | ||
1627 | /* We must make sure we don't detect the IBM Cell | ||
1628 | * blades as pSeries due to some firmware issues, | ||
1629 | * so we do it here. | ||
1630 | */ | ||
1631 | if (strstr(p, RELOC("IBM,CBEA")) || | ||
1632 | strstr(p, RELOC("IBM,CPBW-1.0"))) | ||
1633 | return PLATFORM_GENERIC; | ||
1634 | #endif /* CONFIG_PPC64 */ | ||
1625 | i += sl + 1; | 1635 | i += sl + 1; |
1626 | } | 1636 | } |
1627 | } | 1637 | } |
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 01e3c08cb550..8fdeca2d4597 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
@@ -803,10 +803,13 @@ static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int | |||
803 | if (__get_user(cmcp, &ucp->uc_regs)) | 803 | if (__get_user(cmcp, &ucp->uc_regs)) |
804 | return -EFAULT; | 804 | return -EFAULT; |
805 | mcp = (struct mcontext __user *)(u64)cmcp; | 805 | mcp = (struct mcontext __user *)(u64)cmcp; |
806 | /* no need to check access_ok(mcp), since mcp < 4GB */ | ||
806 | } | 807 | } |
807 | #else | 808 | #else |
808 | if (__get_user(mcp, &ucp->uc_regs)) | 809 | if (__get_user(mcp, &ucp->uc_regs)) |
809 | return -EFAULT; | 810 | return -EFAULT; |
811 | if (!access_ok(VERIFY_READ, mcp, sizeof(*mcp))) | ||
812 | return -EFAULT; | ||
810 | #endif | 813 | #endif |
811 | restore_sigmask(&set); | 814 | restore_sigmask(&set); |
812 | if (restore_user_regs(regs, mcp, sig)) | 815 | if (restore_user_regs(regs, mcp, sig)) |
@@ -908,13 +911,14 @@ int sys_debug_setcontext(struct ucontext __user *ctx, | |||
908 | { | 911 | { |
909 | struct sig_dbg_op op; | 912 | struct sig_dbg_op op; |
910 | int i; | 913 | int i; |
914 | unsigned char tmp; | ||
911 | unsigned long new_msr = regs->msr; | 915 | unsigned long new_msr = regs->msr; |
912 | #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) | 916 | #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) |
913 | unsigned long new_dbcr0 = current->thread.dbcr0; | 917 | unsigned long new_dbcr0 = current->thread.dbcr0; |
914 | #endif | 918 | #endif |
915 | 919 | ||
916 | for (i=0; i<ndbg; i++) { | 920 | for (i=0; i<ndbg; i++) { |
917 | if (__copy_from_user(&op, dbg, sizeof(op))) | 921 | if (copy_from_user(&op, dbg + i, sizeof(op))) |
918 | return -EFAULT; | 922 | return -EFAULT; |
919 | switch (op.dbg_type) { | 923 | switch (op.dbg_type) { |
920 | case SIG_DBG_SINGLE_STEPPING: | 924 | case SIG_DBG_SINGLE_STEPPING: |
@@ -959,6 +963,11 @@ int sys_debug_setcontext(struct ucontext __user *ctx, | |||
959 | current->thread.dbcr0 = new_dbcr0; | 963 | current->thread.dbcr0 = new_dbcr0; |
960 | #endif | 964 | #endif |
961 | 965 | ||
966 | if (!access_ok(VERIFY_READ, ctx, sizeof(*ctx)) | ||
967 | || __get_user(tmp, (u8 __user *) ctx) | ||
968 | || __get_user(tmp, (u8 __user *) (ctx + 1) - 1)) | ||
969 | return -EFAULT; | ||
970 | |||
962 | /* | 971 | /* |
963 | * If we get a fault copying the context into the kernel's | 972 | * If we get a fault copying the context into the kernel's |
964 | * image of the user's registers, we can't just return -EFAULT | 973 | * image of the user's registers, we can't just return -EFAULT |
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 27f65b95184d..c2db642f4cdd 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
@@ -182,6 +182,8 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig, | |||
182 | err |= __get_user(msr, &sc->gp_regs[PT_MSR]); | 182 | err |= __get_user(msr, &sc->gp_regs[PT_MSR]); |
183 | if (err) | 183 | if (err) |
184 | return err; | 184 | return err; |
185 | if (v_regs && !access_ok(VERIFY_READ, v_regs, 34 * sizeof(vector128))) | ||
186 | return -EFAULT; | ||
185 | /* Copy 33 vec registers (vr0..31 and vscr) from the stack */ | 187 | /* Copy 33 vec registers (vr0..31 and vscr) from the stack */ |
186 | if (v_regs != 0 && (msr & MSR_VEC) != 0) | 188 | if (v_regs != 0 && (msr & MSR_VEC) != 0) |
187 | err |= __copy_from_user(current->thread.vr, v_regs, | 189 | err |= __copy_from_user(current->thread.vr, v_regs, |