[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGyNYUO0WGXgN50AXW08Hec97TM-PRm4iNQR5gZ+=wdRz1KUgQ@mail.gmail.com>
Date: Tue, 10 Jan 2012 14:40:27 +0800
From: Eugene Teo <eugeneteo@...nel.sg>
To: Dan Rosenberg <drosenberg@...curity.com>
Cc: liqin.chen@...plusct.com, lennox.wu@...il.com,
linux-kernel@...r.kernel.org, security@...nel.org, arnd@...db.de
Subject: Re: [PATCH] score: fix off-by-one index into syscall table
Cc'ed arnd@...db.de
ping
On Fri, Jan 6, 2012 at 9:21 PM, Dan Rosenberg <drosenberg@...curity.com> wrote:
> 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@...curity.com>
> Cc: stable@...nel.org
> Cc: security@...nel.org
> ---
> arch/score/kernel/entry.S | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/score/kernel/entry.S b/arch/score/kernel/entry.S
> index 577abba..83bb960 100644
> --- a/arch/score/kernel/entry.S
> +++ b/arch/score/kernel/entry.S
> @@ -408,7 +408,7 @@ ENTRY(handle_sys)
> sw r9, [r0, PT_EPC]
>
> cmpi.c r27, __NR_syscalls # check syscall number
> - bgtu illegal_syscall
> + bgeu illegal_syscall
>
> slli r8, r27, 2 # get syscall routine
> la r11, sys_call_table
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists