[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c028cd9e-07ff-03db-ab74-499b94075989@mojatatu.com>
Date: Mon, 9 May 2022 09:34:23 -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 09:14, Paolo Abeni wrote:
> 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.
Fair enough.
>> 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.
>
Only if you have the energy to do it. Otherwise
Acked-by: Jamal Hadi Salim <jhs@...atatu.com>
cheers,
jamal
Powered by blists - more mailing lists