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  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]
Date:   Wed, 13 Jan 2021 16:45:26 -0600
From:   Josh Poimboeuf <jpoimboe@...hat.com>
To:     David Laight <David.Laight@...lab.com>
Cc:     "vanessa.hack@....de" <vanessa.hack@....de>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: objtool/ORC generation for noreturn functions

On Wed, Jan 13, 2021 at 10:39:53PM +0000, David Laight wrote:
> > On Wed, Jan 13, 2021 at 11:44:22AM +0100, vanessa.hack@....de wrote:
> > >    Hi,
> > >    I am currently writing my final thesis at university on the topic of stack
> > >    unwinding. My goal is to implement and evaluate stack unwinders for
> > >    research operating system ports to x86 32 and 64 bit architectures and
> > >    SPARC V8.
> > >    For the x86 ports I chose ORC as unwinding format due to its simplicity
> > >    and reliability. So far, it works quite well (although I've ran into some
> > >    minor issues with objtool as the research OS is written in C++).
> > >    But now I have some problems with functions that are explicitly marked as
> > >    noreturn with the [[noreturn]] attribute, all following unwinding steps
> > >    are unreliable. I have read in the objtool documentation that such
> > >    functions have to be added to the objtool global_noreturn array.
> > >    Unfortunately, I do not understand the purpose of that array and the
> > >    intended ORC behaviour for noreturn functions. Are the unwinding steps
> > >    that follow a noreturn intended to be unreliable?
> 
> There was an 'interesting' unwinder I saw a few years ago.
> (Which couldn't handle 'noreturn' functions.)
> 
> The idea is to follow forwards through the code while keeping
> track of %sp and %fp until a return instruction is found.
> You need to be able to detect loops, and then continue from
> the other target of an earlier conditional branch.
> Provided function calls don't change %sp they can be ignored.
> If the %fp isn't used as a frame pointer it won't get reloaded
> into %sp so it doesn't matter
> 
> This works (most of the time) with no debug info and no symbol
> table.

Almost sounds like an in-kernel version of objtool :-)

-- 
Josh

Powered by blists - more mailing lists