[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFrcx1kCAjoMxBeqaO+iS2CGzX6omuW1reL636Lyj=bg5DB1Rg@mail.gmail.com>
Date: Thu, 5 Dec 2013 13:45:26 +0100
From: Jean Pihet <jean.pihet@...aro.org>
To: Konstantin Khlebnikov <k.khlebnikov@...sung.com>
Cc: Russell King <linux@....linux.org.uk>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Will Deacon <will.deacon@....com>,
Vyacheslav Tyrtov <v.tyrtov@...sung.com>
Subject: Re: [PATCH 2/2] ARM: fix framepointer check in unwind_frame
On 5 December 2013 09:34, Konstantin Khlebnikov
<k.khlebnikov@...sung.com> wrote:
> This patch fixes corner case when (fp + 4) overflows unsigned long,
> for example: fp = 0xFFFFFFFF -> fp + 4 == 3.
>
> Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@...sung.com>
> ---
> arch/arm/kernel/stacktrace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
> index 00f79e5..af4e8c8 100644
> --- a/arch/arm/kernel/stacktrace.c
> +++ b/arch/arm/kernel/stacktrace.c
> @@ -31,7 +31,7 @@ int notrace unwind_frame(struct stackframe *frame)
> high = ALIGN(low, THREAD_SIZE);
>
> /* check current frame pointer is within bounds */
> - if (fp < (low + 12) || fp + 4 >= high)
> + if (fp < low + 12 || fp > high - 4)
Shouldn't that use the '>=' comparison?
Jean
> return -EINVAL;
>
> /* restore the registers from the stack frame */
>
> --
> 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/
--
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