Re: [PATCH v2 1/4] seccomp: Add sysctl to display available actions
From: Kees Cook
Date: Mon Feb 13 2017 - 19:26:46 EST
On Mon, Feb 13, 2017 at 4:25 PM, Tyler Hicks <tyhicks@xxxxxxxxxxxxx> 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