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:   Thu, 17 Oct 2019 12:28:27 -0700
From:   Cong Wang <xiyou.wangcong@...il.com>
To:     Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc:     David Miller <davem@...emloft.net>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>,
        oss-drivers@...ronome.com,
        Stephen Hemminger <stephen@...workplumber.org>,
        kbuild test robot <lkp@...el.com>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        Ben Hutchings <ben@...adent.org.uk>,
        Simon Horman <simon.horman@...ronome.com>
Subject: Re: [PATCH net] net: netem: fix error path for corrupted GSO frames

On Thu, Oct 17, 2019 at 11:44 AM Jakub Kicinski
<jakub.kicinski@...ronome.com> wrote:
>
> On Thu, 17 Oct 2019 11:10:06 -0700, Cong Wang wrote:
> > On Wed, Oct 16, 2019 at 4:22 PM Jakub Kicinski wrote:
> > > On Wed, 16 Oct 2019 15:42:28 -0700, Cong Wang wrote:
> > > > > @@ -612,7 +613,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch,
> > > > >                         }
> > > > >                         segs = skb2;
> > > > >                 }
> > > > > -               qdisc_tree_reduce_backlog(sch, -nb, prev_len - len);
> > > > > +               qdisc_tree_reduce_backlog(sch, !skb - nb, prev_len - len);
> > > >
> > > > Am I the only one has trouble to understand the expression
> > > > "!skb - nb"?
> > >
> > > The backward logic of qdisc_tree_reduce_backlog() always gives me a
> > > pause :S
> >
> > Yeah, reducing with a negative value is actually an add. Feel free
> > to add a wrapper for this if you think it is better.
>
> I was avoiding adding the wrapper due to stable, but perhaps it should
> be okay.

Up to you, you can defer the wrapper to net-next.

>
> How does this look?

"nb - 1" with a comment is much better than "!skb - nb".

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ