Messages in this thread | | | From | Fubo Chen <> | Date | Thu, 15 Dec 2016 13:16:08 +0100 | Subject | Re: [PATCH] userns: suppress kmemleak message |
| |
On Thu, Nov 3, 2016 at 3:54 PM, Eric W. Biederman <ebiederm@xmission.com> wrote: > Dmitry Torokhov <dmitry.torokhov@gmail.com> writes: > >> We do not ever intend to unregister "user" sysctl table, unfortunately >> it leads kmemleak to believe that we are leaking memory: > > Sounds like an issue with kmemleak because we do retain references. > > So no we don't intend to unregister the table. > > As for the patch. > > Nacked-by: "Eric W. Biederman" <ebiederm@xmission.com> > > I can't see the using kmemleak_not_leak is possibly good form. I > would much rather have suggestions about constructs that won't confuse > kmemleak and won't need ugly annotations that serve no purpose but to > appease a tool. Perhaps the user_header variable needs to be moved out > of user_namespace_sysctl_init.
The only alternative I see is to use WRITE_ONCE() instead of "=" to set "user_header" such that the compiler cannot optimize that variable away. Which of these two approaches do you prefer?
Fubo.
| |