Re: [PATCH v2 38/48] objtool: kmsan: list KMSAN API functions as uaccess-safe

From: Peter Zijlstra
Date: Thu Apr 14 2022 - 12:04:37 EST


On Thu, Apr 14, 2022 at 05:30:34PM +0200, Alexander Potapenko wrote:
> On Wed, Mar 30, 2022 at 10:46 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> wrote:
>
> > On Tue, Mar 29, 2022 at 02:40:07PM +0200, Alexander Potapenko wrote:
> > > KMSAN inserts API function calls in a lot of places (function entries
> > > and exits, local variables, memory accesses), so they may get called
> > > from the uaccess regions as well.
> >
> > That's insufficient. Explain how you did the right thing and made these
> > functions actually safe to be called in this context.
> >

> As a result, none of KMSAN API functions perform userspace accesses, but
> since they might be called from UACCESS regions they
> use user_access_save/restore().

^ That.. very good.

Thanks!