On Thu, Oct 6, 2022 at 10:11 AM Pablo Neira Ayuso <[email protected]> wrote:
>
> On Tue, Oct 04, 2022 at 09:19:56PM -0400, Xin Long wrote:
> [...]
> > @@ -1119,6 +1135,22 @@ static int tcf_ct_act(struct sk_buff *skb, const
> > struct tc_action *a,
> > if (err != NF_ACCEPT)
> > goto drop;
> >
> > + if (commit && p->helper && !nfct_help(ct)) {
> > + err = __nf_ct_try_assign_helper(ct, p->tmpl, GFP_ATOMIC);
> > + if (err)
> > + goto drop;
> > + add_helper = true;
> > + if (p->ct_action & TCA_CT_ACT_NAT && !nfct_seqadj(ct)) {
> > + if (!nfct_seqadj_ext_add(ct))
>
> You can only add ct extensions if ct is !nf_ct_is_confirmed(ct)), is
> this guaranteed in this codepath?
This is a good catch, the same issue exists on __nf_ct_try_assign_helper(),
and also in __ovs_ct_lookup().
I could trigger the warning on OVS conntrack with the flow:
table=0, in_port=veth1,tcp,tcp_dst=2121,ct_state=-trk
actions=ct(commit, table=1)
table=1, in_port=veth1,tcp,tcp_dst=2121,ct_state=+trk+new
actions=ct(commit, alg=ftp),normal
I will prepare a fix for ovs conntrack first.
Thanks.
>
> > + return -EINVAL;
> > + }
> > + }
> > +
> > + if (nf_ct_is_confirmed(ct) ? ((!cached && !skip_add) || add_helper) :
> > commit) {
> > + if (nf_ct_helper(skb, family) != NF_ACCEPT)
> > + goto drop;
> > + }
> > +
> > if (commit) {
> > tcf_ct_act_set_mark(ct, p->mark, p->mark_mask);
> > tcf_ct_act_set_labels(ct, p->labels, p->labels_mask);
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev