Messages in this thread | | | Date | Wed, 18 Mar 2020 10:03:09 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH v2 16/19] objtool: Implement noinstr validation |
| |
On Tue, Mar 17, 2020 at 04:00:08PM -0500, Josh Poimboeuf wrote: > 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?
Ah, I sometimes do stuff like:
cp vmlinux.o vmlinux.o.orig quilt push; make -j$lots cp vmlinux.o vmlinux.o.1 quilt push; make -j$lots ...
And then it is nice to force the mode.
> > @@ -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;
Ah, indeed. I totally forgot userspace coding it seems..
| |