lkml.org 
[lkml]   [2009]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH tracing/kprobes 1/7] x86/ptrace: Fix regs_get_argument_nth() to add correct offset
From
Date
On Thu, 2009-09-10 at 19:53 -0400, Masami Hiramatsu wrote:

> ---
>
> arch/x86/kernel/ptrace.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
> index a33a17d..caffb68 100644
> --- a/arch/x86/kernel/ptrace.c
> +++ b/arch/x86/kernel/ptrace.c
> @@ -150,7 +150,7 @@ static const int arg_offs_table[] = {
> unsigned long regs_get_argument_nth(struct pt_regs *regs, unsigned int n)
> {
> if (n < ARRAY_SIZE(arg_offs_table))
> - return *((unsigned long *)regs + arg_offs_table[n]);
> + return *(unsigned long *)((char *)regs + arg_offs_table[n]);

That definitely looks like a bug.

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

> else {
> /*
> * The typical case: arg n is on the stack.
>
>



\
 
 \ /
  Last update: 2009-09-11 10:33    [W:0.349 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site