[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231208154035.7cbec2f7@kernel.org>
Date: Fri, 8 Dec 2023 15:40:35 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: <jhs@...atatu.com>, <pablo@...filter.org>
Cc: Vlad Buslov <vladbu@...dia.com>, <davem@...emloft.net>,
<pabeni@...hat.com>, <edumazet@...gle.com>, <netdev@...r.kernel.org>,
<louis.peens@...igine.com>, <yinjun.zhang@...igine.com>,
<simon.horman@...igine.com>, <jiri@...nulli.us>,
<xiyou.wangcong@...il.com>, Paul Blakey <paulb@...dia.com>
Subject: Re: [PATCH net] net/sched: act_ct: Take per-cb reference to
tcf_ct_flow_table
On Tue, 5 Dec 2023 18:25:54 +0100 Vlad Buslov wrote:
> The referenced change added custom cleanup code to act_ct to delete any
> callbacks registered on the parent block when deleting the
> tcf_ct_flow_table instance. However, the underlying issue is that the
> drivers don't obtain the reference to the tcf_ct_flow_table instance when
> registering callbacks which means that not only driver callbacks may still
> be on the table when deleting it but also that the driver can still have
> pointers to its internal nf_flowtable and can use it concurrently which
> results either warning in netfilter[0] or use-after-free.
>
> Fix the issue by taking a reference to the underlying struct
> tcf_ct_flow_table instance when registering the callback and release the
> reference when unregistering. Expose new API required for such reference
> counting by adding two new callbacks to nf_flowtable_type and implementing
> them for act_ct flowtable_ct type. This fixes the issue by extending the
> lifetime of nf_flowtable until all users have unregistered.
Some acks would be good here - Pablo, Jamal?
--
pw-bot: needs-ack
Powered by blists - more mailing lists