diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-05-23 10:46:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-23 13:35:32 -0400 |
commit | b471f55427ee94d6de2b33b88a7409f8cbc6b5dc (patch) | |
tree | 24458ffccb4f9df1cef2fa65794997fc01ba37b1 | |
parent | 5a4fa1639622b85d7e4422242308fc6cef7e503e (diff) |
[PATCH] powerpc: check Cell SPU syscall number range _before_ using it
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Paul Mackerras <paulus@samba.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/powerpc/platforms/cell/spu_callbacks.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c index 67453147cd99..5a0f9e3beb24 100644 --- a/arch/powerpc/platforms/cell/spu_callbacks.c +++ b/arch/powerpc/platforms/cell/spu_callbacks.c | |||
@@ -339,13 +339,13 @@ long spu_sys_callback(struct spu_syscall_block *s) | |||
339 | { | 339 | { |
340 | long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); | 340 | long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); |
341 | 341 | ||
342 | syscall = spu_syscall_table[s->nr_ret]; | ||
343 | |||
344 | if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { | 342 | if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { |
345 | pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret); | 343 | pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret); |
346 | return -ENOSYS; | 344 | return -ENOSYS; |
347 | } | 345 | } |
348 | 346 | ||
347 | syscall = spu_syscall_table[s->nr_ret]; | ||
348 | |||
349 | #ifdef DEBUG | 349 | #ifdef DEBUG |
350 | print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall); | 350 | print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall); |
351 | printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n", | 351 | printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n", |