Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757972AbcKCOEq (ORCPT ); Thu, 3 Nov 2016 10:04:46 -0400 Received: from mail-lf0-f50.google.com ([209.85.215.50]:36476 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757853AbcKCOEn (ORCPT ); Thu, 3 Nov 2016 10:04:43 -0400 Date: Thu, 3 Nov 2016 14:04:27 +0000 From: Jakub Kicinski To: Dmitry Torokhov Cc: "Eric W. Biederman" , linux-kernel@vger.kernel.org, Kees Cook , Johannes Berg , Maciej =?UTF-8?B?xbtlbmN6eWtvd3NraQ==?= Subject: Re: [PATCH] userns: suppress kmemleak message Message-ID: <20161103140427.5620dde3@jkicinski-Precision-T1700> In-Reply-To: <20161103053948.GA40936@dtor-ws> References: <20161103053948.GA40936@dtor-ws> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1390 Lines: 33 On Wed, 2 Nov 2016 22:39:48 -0700, Dmitry Torokhov wrote: > We do not ever intend to unregister "user" sysctl table, unfortunately > it leads kmemleak to believe that we are leaking memory: > > unreferenced object 0xffff8807383bfd48 (size 96): > comm "swapper/0", pid 1, jiffies 4294894636 (age 278.320s) > hex dump (first 32 bytes): > a0 b4 b0 ba ff ff ff ff 00 00 00 00 01 00 00 00 ................ > 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > backtrace: > [] kmemleak_alloc+0x28/0x50 > [] __kmalloc+0x206/0x5a0 > [] __register_sysctl_table+0xb3/0x1130 > [] register_sysctl+0x1b/0x20 > [] user_namespace_sysctl_init+0x17/0x4c > [] do_one_initcall+0xb7/0x2a0 > [] kernel_init_freeable+0x597/0x636 > [] kernel_init+0x13/0x140 > [] ret_from_fork+0x2a/0x40t show > [] 0xffffffffffffffff > > Let's annotate the pointer as kmemleak_not_leak() to suppress the > kmemleak false positive. > > Reported-by: Jakub Kicinski > Signed-off-by: Dmitry Torokhov > --- > > This was only compiled; Jakub, could you give it a spin? Tested-by: Jakub Kicinski Thanks!