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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251020103940.GP3419281@noisy.programming.kicks-ass.net>
Date: Mon, 20 Oct 2025 12:39:40 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Jens Remus <jremus@...ux.ibm.com>
Cc: jpoimboe@...nel.org, rostedt@...nel.org,
	Indu Bhagat <indu.bhagat@...cle.com>, linux-kernel@...r.kernel.org,
	Heiko Carstens <hca@...ux.ibm.com>,
	Vasily Gorbik <gor@...ux.ibm.com>
Subject: Re: [PATCH 11/12] unwind: Implement compat fp unwind

On Mon, Oct 20, 2025 at 11:16:45AM +0200, Jens Remus wrote:
> Hello Peter!
> 
> On 10/17/2025 5:47 PM, Jens Remus wrote:
> > while rebasing the unwind user sframe series on top of this series and
> > https://lore.kernel.org/linux-trace-kernel/20251007214008.080852573@kernel.org/
> > I ran into the following issue:
> > 
> > On 9/24/2025 9:59 AM, Peter Zijlstra wrote:
> > 
> >> --- a/include/linux/unwind_user_types.h
> >> +++ b/include/linux/unwind_user_types.h
> >> @@ -36,6 +36,7 @@ struct unwind_user_state {
> >>  	unsigned long				ip;
> >>  	unsigned long				sp;
> >>  	unsigned long				fp;
> >> +	unsigned int				ws;
> > 
> > Factoring out the word size (ws) from the CFA, FP, and RA offsets is
> > clever.  Wondering though whether that would be an issue for unwind user
> > sframe.  Do all architectures guarantee that those offsets are aligned
> > to the native word size?
> > 
> >>  	enum unwind_user_type			current_type;
> >>  	unsigned int				available_types;
> >>  	bool					done;
> > 
> >> --- a/kernel/unwind/user.c
> >> +++ b/kernel/unwind/user.c
> > 
> >> @@ -29,21 +44,21 @@ static int unwind_user_next_fp(struct un
> >>  	}
> >>  
> >>  	/* Get the Canonical Frame Address (CFA) */
> >> -	cfa += frame->cfa_off;
> >> +	cfa += state->ws * frame->cfa_off;
> > 
> > In SFrame the CFA, FP, and RA offsets are unscaled.  Would it be ok, if
> > unwind user sframe would factor state->ws from those offset values?  What
> > if they were not aligned?  unwind user sframe would then have to fail.
> 
> Sorry that I did not immediately think about the most obvious solution
> tho above issues:  to not factor out the word size from the frame CFA,
> FP, and RA offsets.  What do you think about making the following
> changes to this and giyour subsequent patch?  That would work nicely
> with unwind user sframe.


Yes, this should do nicely. I've made the changes, I'll do a test build
and then push out to the robots.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ