[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200708072200.GC353684@kroah.com>
Date: Wed, 8 Jul 2020 09:22:00 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, saeedm@...lanox.com,
michael.chan@...adcom.com, edwin.peer@...adcom.com,
emil.s.tantilov@...el.com, alexander.h.duyck@...ux.intel.com,
jeffrey.t.kirsher@...el.com, tariqt@...lanox.com, mkubecek@...e.cz,
Marek Szyprowski <m.szyprowski@...sung.com>,
Chucheng Luo <luochucheng@...o.com>
Subject: Re: [PATCH net-next 1/9] debugfs: make sure we can remove u32_array
files cleanly
On Tue, Jul 07, 2020 at 02:24:26PM -0700, Jakub Kicinski wrote:
> debugfs_create_u32_array() allocates a small structure to wrap
> the data and size information about the array. If users ever
> try to remove the file this leads to a leak since nothing ever
> frees this wrapper.
>
> That said there are no upstream users of debugfs_create_u32_array()
> that'd remove a u32 array file (we only have one u32 array user in
> CMA), so there is no real bug here.
>
> Make callers pass a wrapper they allocated. This way the lifetime
> management of the wrapper is on the caller, and we can avoid the
> potential leak in debugfs.
>
> CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> CC: Marek Szyprowski <m.szyprowski@...sung.com>
> CC: Chucheng Luo <luochucheng@...o.com>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Powered by blists - more mailing lists