[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a88b242a-a6ca-466e-9ca2-627e9193b1e3@redhat.com>
Date: Thu, 5 Dec 2024 09:35:10 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Eric Dumazet <edumazet@...gle.com>, "David S . Miller"
<davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com,
Ilya Maximets <i.maximets@....org>,
Dan Streetman <dan.streetman@...onical.com>,
Steffen Klassert <steffen.klassert@...unet.com>
Subject: Re: [PATCH v2 net] net: defer final 'struct net' free in netns
dismantle
On 12/4/24 13:54, Eric Dumazet wrote:
> Ilya reported a slab-use-after-free in dst_destroy [1]
>
> Issue is in xfrm6_net_init() and xfrm4_net_init() :
>
> They copy xfrm[46]_dst_ops_template into net->xfrm.xfrm[46]_dst_ops.
>
> But net structure might be freed before all the dst callbacks are
> called. So when dst_destroy() calls later :
>
> if (dst->ops->destroy)
> dst->ops->destroy(dst);
>
> dst->ops points to the old net->xfrm.xfrm[46]_dst_ops, which has been freed.
>
> See a relevant issue fixed in :
>
> ac888d58869b ("net: do not delay dst_entries_add() in dst_release()")
>
> A fix is to queue the 'struct net' to be freed after one
> another cleanup_net() round (and existing rcu_barrier())
I'm sorry for the late feedback.
If I read correctly the above means that the actual free could be
delayed for an unlimited amount of time, did I misread something?
I guess the reasoning is that the total amount of memory used by the
netns struct should be neglicible?
I'm wondering about potential ill side effects WRT containers
deployments under memory pressure.
Thanks,
Paolo
Powered by blists - more mailing lists