lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 19 Jan 2023 01:15:57 -0300
From:   Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
To:     Vlad Buslov <vladbu@...dia.com>
Cc:     davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
        pablo@...filter.org, netdev@...r.kernel.org,
        netfilter-devel@...r.kernel.org, jhs@...atatu.com,
        xiyou.wangcong@...il.com, jiri@...nulli.us, ozsh@...dia.com,
        simon.horman@...igine.com
Subject: Re: [PATCH net-next v2 1/7] net: flow_offload: provision conntrack
 info in ct_metadata

On Tue, Jan 17, 2023 at 07:28:09PM +0200, Vlad Buslov wrote:
> On Tue 17 Jan 2023 at 12:09, Marcelo Ricardo Leitner <marcelo.leitner@...il.com> wrote:
> > On Tue, Jan 17, 2023 at 12:04:32PM -0300, Marcelo Ricardo Leitner wrote:
> >> On Fri, Jan 13, 2023 at 05:55:42PM +0100, Vlad Buslov wrote:
> >> ...
> >> >  struct flow_match {
> >> > @@ -288,6 +289,7 @@ struct flow_action_entry {
> >> >  		} ct;
> >> >  		struct {
> >> >  			unsigned long cookie;
> >> > +			enum ip_conntrack_info ctinfo;
> >> >  			u32 mark;
> >> >  			u32 labels[4];
> >> >  			bool orig_dir;
> >> > diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
> >> > index 0ca2bb8ed026..515577f913a3 100644
> >> > --- a/net/sched/act_ct.c
> >> > +++ b/net/sched/act_ct.c
> >> > @@ -187,6 +187,7 @@ static void tcf_ct_flow_table_add_action_meta(struct nf_conn *ct,
> >> >  	/* aligns with the CT reference on the SKB nf_ct_set */
> >> >  	entry->ct_metadata.cookie = (unsigned long)ct | ctinfo;
> >>                                                    ^^^^^^^^^^^
> >
> > Hmm. Thought that just came up and still need to dig into, but wanted
> > to share/ask already. Would it be a problem to update the cookie later
> > on then, to reflect the new ctinfo?
> 
> Not sure I'm following, but every time the flow changes state it is
> updated in the driver since new metadata is generated by calling
> tcf_ct_flow_table_fill_actions() from nf_flow_offload_rule_alloc().

Whoops.. missed to reply this one.

I worried that the cookie perhaps was used a hash index or so, and
with such update on it, then maybe the key would be changing under the
carpet. Checked now, I don't see such issue.

I guess that's it from my side then. :)

> 
> >
> >> 
> >> >  	entry->ct_metadata.orig_dir = dir == IP_CT_DIR_ORIGINAL;
> >> > +	entry->ct_metadata.ctinfo = ctinfo;
> >> 
> >> tcf_ct_flow_table_restore_skb() is doing:
> >>         enum ip_conntrack_info ctinfo = cookie & NFCT_INFOMASK;
> >> 
> >> Not sure if it really needs this duplication then.
> >> 
> >> >  
> >> >  	act_ct_labels = entry->ct_metadata.labels;
> >> >  	ct_labels = nf_ct_labels_find(ct);
> >> > -- 
> >> > 2.38.1
> >> > 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ