Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1514302

Re: [RFC] make kmemleak scan __ro_after_init section (was: Re: [PATCH 0/5] genetlink improvements)

From Cong Wang <xiyou.wangcong@gmail.com>
Newsgroups linux.kernel
Subject Re: [RFC] make kmemleak scan __ro_after_init section (was: Re: [PATCH 0/5] genetlink improvements)
Date 2016-11-03 06:50 +0100
Message-ID <szj4t-8aX-9@gated-at.bofh.it> (permalink)
References (1 earlier) <szds6-4tX-9@gated-at.bofh.it> <szds6-4tX-11@gated-at.bofh.it> <szds6-4tX-13@gated-at.bofh.it> <szds6-4tX-15@gated-at.bofh.it> <szds5-4tX-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Nov 2, 2016 at 4:47 PM, Jakub Kicinski <kubakici@wp.pl> wrote:
>
> Thanks for looking into this!  Bisect led me to the following commit:
>
> commit 56989f6d8568c21257dcec0f5e644d5570ba3281
> Author: Johannes Berg <johannes.berg@intel.com>
> 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 <johannes.berg@intel.com>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
>
>
> 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. ;)

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC] make kmemleak scan __ro_after_init section (was: Re: [PATCH  0/5] genetlink improvements) Jakub Kicinski <kubakici@wp.pl> - 2016-11-03 00:50 +0100
  Re: [RFC] make kmemleak scan __ro_after_init section (was: Re: [PATCH  0/5] genetlink improvements) Cong Wang <xiyou.wangcong@gmail.com> - 2016-11-03 06:50 +0100
  Re: [RFC] make kmemleak scan __ro_after_init section (was: Re:  [PATCH 0/5] genetlink improvements) Johannes Berg <johannes@sipsolutions.net> - 2016-11-03 17:00 +0100
  Re: [RFC] make kmemleak scan __ro_after_init section (was: Re:  [PATCH 0/5] genetlink improvements) Catalin Marinas <catalin.marinas@arm.com> - 2016-11-03 21:50 +0100

csiph-web