lkml.org 
[lkml]   [2020]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 26/26] objtool: Add STT_NOTYPE noinstr validation
On Wed, Mar 25, 2020 at 04:53:48PM +0100, Peter Zijlstra wrote:
> On Wed, Mar 25, 2020 at 09:42:11AM -0500, Josh Poimboeuf wrote:
> > Sure, but couldn't validate_unwind_hints() and
> > validate_reachable_instructions() be changed to *only* run on
> > .noinstr.text, for the vmlinux case? That might help converge the
> > vmlinux and !vmlinux paths.
>
> You're thinking something like so then?

Not exactly. But I don't want to keep churning this patch set. I can
add more patches later, so don't worry about it.

But I was thinking it would eventually be good to have the top-level
check() be like

sec = NULL;
if (!validate_all)
sec = find_section_by_name(file->elf, ".noinstr.text");

ret = validate_functions(&file, sec);
if (ret < 0)
goto out;
warnings += ret;

ret = validate_unwind_hints(&file, sec);
if (ret < 0)
goto out;
warnings += ret;

if (!warnings) {
ret = validate_reachable_instructions(&file, sec);
if (ret < 0)
goto out;
warnings += ret;
}

if (!validate_all)
goto out;

ret = validate_retpoline(&file);
....

that way the general flow is the same regardless...

--
Josh

\
 
 \ /
  Last update: 2020-03-25 17:41    [W:0.214 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site