Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755581AbcLOMQ0 (ORCPT ); Thu, 15 Dec 2016 07:16:26 -0500 Received: from mail-yb0-f169.google.com ([209.85.213.169]:35500 "EHLO mail-yb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755142AbcLOMQY (ORCPT ); Thu, 15 Dec 2016 07:16:24 -0500 MIME-Version: 1.0 In-Reply-To: <87a8dgvcke.fsf@xmission.com> References: <20161103053948.GA40936@dtor-ws> <87a8dgvcke.fsf@xmission.com> From: Fubo Chen Date: Thu, 15 Dec 2016 13:16:08 +0100 Message-ID: Subject: Re: [PATCH] userns: suppress kmemleak message To: "Eric W. Biederman" Cc: Dmitry Torokhov , Jakub Kicinski , Linux Kernel , Kees Cook , Johannes Berg , =?UTF-8?Q?Maciej_=C5=BBenczykowski?= Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 995 Lines: 25 On Thu, Nov 3, 2016 at 3:54 PM, Eric W. Biederman wrote: > Dmitry Torokhov 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" > > 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.