lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 22 Sep 2011 14:19:37 +0100
From:	"Jon Medhurst (Tixy)" <jon.medhurst@...aro.org>
To:	Catalin Marinas <catalin.marinas@....com>
Cc:	Russell King - ARM Linux <linux@....linux.org.uk>,
	Dave Martin <dave.martin@...aro.org>,
	Laura Abbott <lauraa@...eaurora.org>,
	Nicolas Pitre <nico@...xnic.net>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] arm: Add unwinding annotations for 64bit division
 functions

On Thu, 2011-09-22 at 14:00 +0100, Catalin Marinas wrote:
> The unwinding fix should be simple (I haven't tested it yet):
> 
> 8<-----------------------------
> ARM: Ignore the unwinding information for the first instruction in a function
> 
> From: Catalin Marinas <catalin.marinas@....com>
> 
> When backtracing from the first instruction of a function, the prologue
> has not been executed and the unwinding information is not valid. This
> patch checks for this case and just assumes that the return address is
> in LR.
> 
> Signed-off-by: Catalin Marinas <catalin.marinas@....com>
> ---
>  arch/arm/kernel/unwind.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c
> index d2cb0b3..946face 100644
> --- a/arch/arm/kernel/unwind.c
> +++ b/arch/arm/kernel/unwind.c
> @@ -293,6 +293,16 @@ int unwind_frame(struct stackframe *frame)
>  		return -URC_FAILURE;
>  	}
>  
> +	/*
> +	 * Check for backtrace on the first instruction of a function. The
> +	 * prologue has not been executed yet and the unwinding information is
> +	 * not valid. Assume that the return address is in LR.
> +	 */
> +	if (idx.addr == frame->pc) {
> +		frame->pc = frame->lr;
> +		return URC_OK;
> +	}
> +
>  	ctrl.vrs[FP] = frame->fp;
>  	ctrl.vrs[SP] = frame->sp;
>  	ctrl.vrs[LR] = frame->lr;
> 

I've never looked at the unwinding code before but the one comment I
would make is: does the patch work with Thumb code? I.e. does bit zero
of idx.addr, frame->pc or frame->lr ever get set to indicate Thumb
state? And if so, they had better all get set otherwise it won't
work :-)

-- 
Tixy

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ