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] [day] [month] [year] [list]
Date: Wed, 7 Jun 2023 11:59:23 +0100
From: Max Tottenham <mtottenh@...mai.com>
To: Pedro Tammela <pctammela@...atatu.com>
CC: Josh Hunt <johunt@...mai.com>, <netdev@...r.kernel.org>,
        Jamal Hadi Salim
	<jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>, Jiri Pirko
	<jiri@...nulli.us>,
        Amir Vadai <amir@...ai.me>, kernel test robot
	<lkp@...el.com>
Subject: Re: [PATCH v2] net/sched: act_pedit: Parse L3 Header for L4 offset

On 05/27, Pedro Tammela wrote:
> On 26/05/2023 18:54, Josh Hunt wrote:
> > On 5/26/23 7:03 AM, Pedro Tammela wrote:
> >> On 26/05/2023 10:47, Pedro Tammela wrote:
> >>>
> >>>> +
> >>>> +    switch (skb->protocol) {
> >>>> +    case htons(ETH_P_IP):
> >>>> +        if (!pskb_may_pull(skb, sizeof(*iph) + noff))
> >>>> +            goto out;
> >>>
> >>> I might have missed something but is this really needed?
> >>> https://elixir.bootlin.com/linux/latest/source/net/ipv4/ip_input.c#L456 
> >>
> >> Yes this obviously happens before the mentioned function.
> >> Now I'm wondering if it's not better to use skb_header_pointer() 
> >> instead...
> > 
> > Can you elaborate on why you think it would be better?
> > 
> 
> I don't have a strong argument for one over the other and I believe it's 
> fine as is.
> It just looks like 'skb_header_pointer()' is a more conservative 
> approach as ithas a smaller margin for errorwhen compared to 
> 'pskb_may_pull()'.
> But I shall admit that the errors conditions for 'pskb_may_pull()' are 
> extreme.
> 
Okay, I'm happy to re-spin a v3 addressing the above, and the other nits
you identified.

-- 
Max Tottenham | Senior Software Engineer
/(* Akamai Technologies

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ