From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f69.google.com (mail-oi0-f69.google.com [209.85.218.69]) by kanga.kvack.org (Postfix) with ESMTP id 69F576B02BF for ; Thu, 3 Nov 2016 01:40:38 -0400 (EDT) Received: by mail-oi0-f69.google.com with SMTP id w63so7806589oiw.4 for ; Wed, 02 Nov 2016 22:40:38 -0700 (PDT) Received: from mail-oi0-x241.google.com (mail-oi0-x241.google.com. [2607:f8b0:4003:c06::241]) by mx.google.com with ESMTPS id e68si4152737oib.253.2016.11.02.22.40.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 22:40:37 -0700 (PDT) Received: by mail-oi0-x241.google.com with SMTP id 128so4789366oih.3 for ; Wed, 02 Nov 2016 22:40:37 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20161102234755.4381f528@jkicinski-Precision-T1700> References: <1477312805-7110-1-git-send-email-johannes@sipsolutions.net> <20161101172840.6d7d6278@jkicinski-Precision-T1700> <20161101185630.3c7d326f@jkicinski-Precision-T1700> <20161102234755.4381f528@jkicinski-Precision-T1700> From: Cong Wang Date: Wed, 2 Nov 2016 22:40:17 -0700 Message-ID: Subject: Re: [RFC] make kmemleak scan __ro_after_init section (was: Re: [PATCH 0/5] genetlink improvements) Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Jakub Kicinski Cc: Johannes Berg , Linux Kernel Network Developers , LKML , Catalin Marinas , linux-mm@kvack.org On Wed, Nov 2, 2016 at 4:47 PM, Jakub Kicinski wrote: > > Thanks for looking into this! Bisect led me to the following commit: > > commit 56989f6d8568c21257dcec0f5e644d5570ba3281 > Author: Johannes Berg > Date: Mon Oct 24 14:40:05 2016 +0200 > > genetlink: mark families as __ro_after_init > > Now genl_register_family() is the only thing (other than the > users themselves, perhaps, but I didn't find any doing that) > writing to the family struct. > > In all families that I found, genl_register_family() is only > called from __init functions (some indirectly, in which case > I've add __init annotations to clarifly things), so all can > actually be marked __ro_after_init. > > This protects the data structure from accidental corruption. > > Signed-off-by: Johannes Berg > Signed-off-by: David S. Miller > > > I realized that kmemleak is not scanning the __ro_after_init section... > Following patch solves the false positives but I wonder if it's the > right/acceptable solution. Nice work! Looks reasonable to me, but I am definitely not familiar with kmemleak. ;) -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org