[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210115000359.dxzivd7hvqvhkqji@treble>
Date: Thu, 14 Jan 2021 18:03:59 -0600
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Mark Rutland <mark.rutland@....com>
Cc: Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org,
Jiri Kosina <jikos@...nel.org>,
Joe Lawrence <joe.lawrence@...hat.com>,
Jonathan Corbet <corbet@....net>,
Miroslav Benes <mbenes@...e.cz>,
Petr Mladek <pmladek@...e.com>, linux-doc@...r.kernel.org,
live-patching@...r.kernel.org
Subject: Re: [PATCH] Documentation: livepatch: document reliable stacktrace
On Thu, Jan 14, 2021 at 06:10:13PM +0000, Mark Rutland wrote:
> On Wed, Jan 13, 2021 at 04:25:41PM -0600, Josh Poimboeuf wrote:
> > On Wed, Jan 13, 2021 at 08:23:15PM +0000, Mark Brown wrote:
> > > On Wed, Jan 13, 2021 at 01:33:13PM -0600, Josh Poimboeuf wrote:
> > >
> > > > I think it's worth mentioning a little more about objtool. There are a
> > > > few passing mentions of objtool's generation of metadata (i.e. ORC), but
> > > > objtool has another relevant purpose: stack validation. That's
> > > > particularly important when it comes to frame pointers.
> > >
> > > > For some architectures like x86_64 and arm64 (but not powerpc/s390),
> > > > it's far too easy for a human to write asm and/or inline asm which
> > > > violates frame pointer protocol, silently causing the violater's callee
> > > > to get skipped in the unwind. Such architectures need objtool
> > > > implemented for CONFIG_STACK_VALIDATION.
> > >
> > > This basically boils down to just adding a statement saying "you may
> > > need to depend on objtool" I think?
> >
> > Right, but maybe it would be a short paragraph or two.
>
> I reckon that's a top-level section between requirements and
> consideration along the lines of:
>
> 3. Compile-time analysis
> ========================
>
> To ensure that kernel code can be correctly unwound in all cases,
> architectures may need to verify that code has been compiled in a manner
> expected by the unwinder. For example, an unwinder may expect that
> functions manipulate the stack pointer in a limited way, or that all
> functions use specific prologue and epilogue sequences. Architectures
> with such requirements should verify the kernel compilation using
> objtool.
>
> In some cases, an unwinder may require metadata to correctly unwind.
> Where necessary, this metadata should be generated at build time using
> objtool.
Sounds good to me.
--
Josh
Powered by blists - more mailing lists