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: <20251024141056.GV4067720@noisy.programming.kicks-ass.net>
Date: Fri, 24 Oct 2025 16:10:56 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: jpoimboe@...nel.org, rostedt@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 11/12] unwind: Implement compat fp unwind

On Wed, Oct 22, 2025 at 02:31:40PM -0400, Steven Rostedt wrote:
> On Wed, 24 Sep 2025 09:59:59 +0200
> Peter Zijlstra <peterz@...radead.org> wrote:
> 
> > @@ -100,6 +115,7 @@ static int unwind_user_start(struct unwi
> >  	state->ip = instruction_pointer(regs);
> >  	state->sp = user_stack_pointer(regs);
> >  	state->fp = frame_pointer(regs);
> > +	state->ws = compat_user_mode(regs) ? sizeof(int) : sizeof(long);
> 
> compat_user_mode() is an architecture function (only defined in arm64 and now x86).
> 
> s390 doesn't implement it and regs can't be used to tell if it's compat or
> not (although Jens tells me the task_struct can).

I've made this:

	state->ws = unwind_user_word_size(regs);

And then every arch will need to implement this. The x86 implementations
is:

static inline int unwind_user_word_size(struct pt_regs *regs)
{
#ifdef CONFIG_X86_64
       if (!user_64bit_mode(regs))
               return sizeof(int);
#endif
       return sizeof(long);
}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ