On Mon, Feb 13, 2017 at 4:25 PM, Tyler Hicks <tyhicks(a)canonical.com> wrote:
kmemleak doesn't complain if we save it to a global. That makes
sense
because it means that we have a persistent reference to the allocated
memory.
However, kmemleak doesn't complain about this allocation as-is (meaning
that I simply removed the call to kmemleak_not_leak()). From what I can
tell, this is because a reference to the allocated ctl_table_header
struct is saved when __register_sysctl_table() calls init_header(). I
think kmemleak is seeing this reference when doing scans and
(incorrectly) thinking that there's no leak.
I think the safest/cleanest thing to do is leave the call to
kmemleak_not_leak(). Let me know if you disagree.
Okay, that's cool. :) Thanks for checking!
-Kees
--
Kees Cook
Pixel Security