score: fix off-by-one index into syscall table
commit18105e188320040b4ebdce3ac4231d719b61aedf
authorDan Rosenberg <drosenberg@vsecurity.com>
Fri, 20 Jan 2012 22:34:27 +0000 (20 14:34 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 25 Jan 2012 21:53:25 +0000 (25 13:53 -0800)
treef702b38a92c1905c5e836b594bfb71c4d24db436
parent751153cccad7b285060c11af30379fcf599dc625
score: fix off-by-one index into syscall table

commit c25a785d6647984505fa165b5cd84cfc9a95970b upstream.

If the provided system call number is equal to __NR_syscalls, the
current check will pass and a function pointer just after the system
call table may be called, since sys_call_table is an array with total
size __NR_syscalls.

Whether or not this is a security bug depends on what the compiler puts
immediately after the system call table.  It's likely that this won't do
anything bad because there is an additional NULL check on the syscall
entry, but if there happens to be a non-NULL value immediately after the
system call table, this may result in local privilege escalation.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: Chen Liqin <liqin.chen@sunplusct.com>
Cc: Lennox Wu <lennox.wu@gmail.com>
Cc: Eugene Teo <eugeneteo@kernel.sg>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/score/kernel/entry.S