Re: [PATCH v3 nf-next 2/2] netfilter: nf_tables: support updating userdata for nft_table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 12, 2024 at 03:10:46PM +0100, Florian Westphal wrote:
> Quan Tian <tianquan23@xxxxxxxxx> wrote:
> > -				trans->ctx.table->flags &= ~__NFT_TABLE_F_UPDATE;
> > +				swap(trans->ctx.table->udata, nft_trans_table_udata(trans));
> > +				nf_tables_table_notify(&trans->ctx, NFT_MSG_NEWTABLE);
> 
> I missed this in my review, as Pablo pointed out you can't use swap()
> here, because table->udata is rcu protected.
> 
> Something like this should work as replacement:
> 
> nft_trans_table_udata(trans) = rcu_replace_pointer(trans->ctx.table->udata,
>                                                    nft_trans_table_udata(trans),
> 						   lockdep_commit_lock_is_held(trans->ctx.net));
> 
> This will swap and ensure all stores are visible.

Thank you Pablo and Florian for pointing it out. I will fix it following
your suggestions.

Thanks,
Quan




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux