Commit b471f554 authored by David Woodhouse's avatar David Woodhouse Committed by Linus Torvalds

[PATCH] powerpc: check Cell SPU syscall number range _before_ using it

Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: default avatarPaul Mackerras <paulus@samba.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5a4fa163
...@@ -339,13 +339,13 @@ long spu_sys_callback(struct spu_syscall_block *s) ...@@ -339,13 +339,13 @@ long spu_sys_callback(struct spu_syscall_block *s)
{ {
long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
syscall = spu_syscall_table[s->nr_ret];
if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret); pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret);
return -ENOSYS; return -ENOSYS;
} }
syscall = spu_syscall_table[s->nr_ret];
#ifdef DEBUG #ifdef DEBUG
print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall); print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall);
printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n", printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment