lkml.org 
[lkml]   [2020]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2 16/19] objtool: Implement noinstr validation
    On Tue, Mar 17, 2020 at 06:02:50PM +0100, Peter Zijlstra wrote:
    > Validate that any call out of .noinstr.text is in between
    > instr_begin() and instr_end() annotations.
    >
    > This annotation is useful to ensure correct behaviour wrt tracing
    > sensitive code like entry/exit and idle code. When we run code in a
    > sensitive context we want a guarantee no unknown code is ran.
    >
    > Since this validation relies on knowing the section of call
    > destination symbols, we must run it on vmlinux.o instead of on
    > individual object files.
    >
    > Add two options:
    >
    > -d/--duplicate "duplicate validation for vmlinux"
    > -l/--vmlinux "vmlinux.o validation"

    I'm not sure I see the point of the --vmlinux option, when it will be
    autodetected anyway?

    > @@ -46,5 +49,9 @@ int cmd_check(int argc, const char **arg
    >
    > objname = argv[0];
    >
    > + s = strstr(objname, "vmlinux.o");
    > + if (s && !s[9])
    > + vmlinux = true;
    > +

    I think this would be slightly cleaner:

    if (!strcmp(basename(objname), "vmlinux.o"))
    vmlinux = true;

    --
    Josh

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