Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757527AbcKCPGk (ORCPT ); Thu, 3 Nov 2016 11:06:40 -0400 Received: from mx4.wp.pl ([212.77.101.11]:46420 "EHLO mx4.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755945AbcKCPGj (ORCPT ); Thu, 3 Nov 2016 11:06:39 -0400 Date: Thu, 3 Nov 2016 15:06:31 +0000 From: Jakub Kicinski To: ebiederm@xmission.com (Eric W. Biederman) Cc: Dmitry Torokhov , linux-kernel@vger.kernel.org, Kees Cook , Johannes Berg , Maciej =?UTF-8?B?xbtlbmN6eWtvd3NraQ==?= Subject: Re: [PATCH] userns: suppress kmemleak message Message-ID: <20161103150631.0c655722@jkicinski-Precision-T1700> In-Reply-To: <87a8dgvcke.fsf@xmission.com> References: <20161103053948.GA40936@dtor-ws> <87a8dgvcke.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-WP-MailID: 3bdd5bc9835f926a0e6d1d019f537708 X-WP-AV: skaner antywirusowy poczty Nowej Poczty X-WP-SPAM: NO 0000000 [AXP0] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1014 Lines: 24 On Thu, 03 Nov 2016 09:54:25 -0500, 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. FWIW the problem now is that the compiler is clever enough to never write the pointer to memory so kmemleak can't find it. user_header is just held in a register for as long as it's needed even though the variable is static.