[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZXbWqP3oO7gtliMK@calendula>
Date: Mon, 11 Dec 2023 10:30:16 +0100
From: Pablo Neira Ayuso <pablo@...filter.org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: jhs@...atatu.com, 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 Fri, Dec 08, 2023 at 03:40:35PM -0800, Jakub Kicinski wrote:
> 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?
Acked-by: Pablo Neira Ayuso <pablo@...filter.org>
I'd prefer driver does not access nf_flowtable directly, I already
mentioned this in the past.
Powered by blists - more mailing lists