[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1941abbcd1b9f33061d90533313da0efdb171a93.camel@redhat.com>
Date: Mon, 09 May 2022 15:14:00 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Jamal Hadi Salim <jhs@...atatu.com>, netdev@...r.kernel.org
Cc: Cong Wang <xiyou.wangcong@...il.com>, Jiri Pirko <jiri@...nulli.us>
Subject: Re: [PATCH v2 net] net/sched: act_pedit: really ensure the skb is
writable
On Mon, 2022-05-09 at 08:16 -0400, Jamal Hadi Salim wrote:
> On 2022-05-09 07:33, Paolo Abeni wrote:
>
> [..]
> > goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
> > @@ -308,13 +320,18 @@ static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
> > struct tcf_result *res)
> > {
> > struct tcf_pedit *p = to_pedit(a);
> > + u32 max_offset;
> > int i;
> >
> > - if (skb_unclone(skb, GFP_ATOMIC))
> > - return p->tcf_action;
> > -
> > spin_lock(&p->tcf_lock);
> >
> > + max_offset = (skb_transport_header_was_set(skb) ?
> > + skb_transport_offset(skb) :
> > + skb_network_offset(skb)) +
> > + p->tcfp_off_max_hint;
> > + if (skb_ensure_writable(skb, min(skb->len, max_offset)))
> > + goto unlock;
> > +
>
> goto bad; would have been better so we can record it in the stats?
I thought about that, but it looked like an unexpected behavioral
change: currently skb_unclone() failures do not touch stats.
>
> Other than that LGTM.
> The commit message is good - but it would be better if you put that
> example that triggered it.
Please let me know if you prefer another revision to cope with the
above.
Thanks!
Paolo
Powered by blists - more mailing lists