[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b898299d-7361-f5e9-2e0e-aa5a0686faab@mojatatu.com>
Date: Mon, 9 May 2022 08:16:37 -0400
From: Jamal Hadi Salim <jhs@...atatu.com>
To: Paolo Abeni <pabeni@...hat.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 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?
Other than that LGTM.
The commit message is good - but it would be better if you put that
example that triggered it.
cheers,
jamal
Powered by blists - more mailing lists