Re: [PATCH 18/20] objtool: Add UACCESS validation
From: Josh Poimboeuf
Date: Fri Mar 08 2019 - 10:01:19 EST
On Thu, Mar 07, 2019 at 08:03:13PM +0100, Peter Zijlstra wrote:
> On Thu, Mar 07, 2019 at 07:48:13PM +0100, Peter Zijlstra wrote:
> > On Thu, Mar 07, 2019 at 09:54:14AM -0800, Linus Torvalds wrote:
> > > On Thu, Mar 7, 2019 at 9:41 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > > > >
> > > > > What's the call site that made you go "just add __memset() to the list"?
> > > >
> > > > __asan_{,un}poinson_stack_memory()
> > > > kasan_{,un}poison_shadow()
> > > > __memset()
> > >
> > > Ugh. I think I almost just agree with your decision to just let that
> > > memset go unchecked.
> > >
> > > I'm not saying it's right, but it doesn't seem to be a fight worth fighting.
> >
> > One think I could do; is add a filter to each function and only allow
> > __memset from the kasan code, and not from anywhere else.
>
> Ah.. how about I feed objtool a text file with all these symbol names;
> and I have Makefile compose file that from fragments.
>
> Then only KASAN builds will have memset whitelisted, and any other build
> will still flag memset abuse.
>
> Now I only have to figure out how to make Makefile do something like
> that :-)
Instead of adding all those additional moving parts, I would much rather
either:
a) have kasan call a special whitelisted version of memset (like hpa
suggested); or
b) just don't use the objtool --uaccess flag for KASAN builds.
--
Josh