[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4857C2B8.8070004@trash.net>
Date: Tue, 17 Jun 2008 15:57:12 +0200
From: Patrick McHardy <kaber@...sh.net>
To: Pekka Enberg <penberg@...helsinki.fi>
CC: netfilter-devel@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, mpm@...enic.com, clameter@....com
Subject: Re: [PATCH] netfilter: use krealloc() in nf_conntrack_extend.c V2
Pekka Enberg wrote:
> Patrick McHardy wrote:
>> Great, thanks for the explanation. Is this patch targeted
>> at 2.6.26 or 2.6.27?
>
> I don't think we will be removing ksize() in 2.6.26 anyway so 2.6.27 is
> fine for this patch. Thanks!
Your patch introduced a use-after-free and double-free.
krealloc() frees the old pointer, but it is still used
for the ->move operations, then freed again.
To fix this I think we need a __krealloc() that doesn't
free the old memory, especially since it must not be
freed immediately because it may still be used in a RCU
read side (see the last part in the patch attached to
this mail (based on a kernel without your patch)).
View attachment "01.diff" of type "text/x-diff" (3307 bytes)
Powered by blists - more mailing lists