Subject: Re: [PATCH 2/2] netfilter: revert "conntrack: silent a memory leak warning"

From: Florian Westphal <[email-masked]>
Date: Tue, 8 Oct 2019 08:04:14 +0200

Maciej Żenczykowski <[email-masked]> wrote:
> From: Maciej Żenczykowski <[email-masked]>
> 
> This reverts commit 114aa35d06d4920c537b72f9fa935de5dd205260.
> 
> By my understanding of kmemleak the reasoning for this patch
> is incorrect.  If kmemleak couldn't handle rcu we'd have it
> reporting leaks all over the place.  My belief is that this
> was instead papering over a real leak.

Perhaps, but note that this is related to nfct->ext, not nfct itself.

I think we could remove __krealloc and use krealloc directly with
a bit of changes in the nf_conntrack core to make sure we do not
access nfct->ext without holding a reference to nfct, and then drop
rcu protection of nfct->ext, I don't think its strictly required anymore.