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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1486650847.7793.93.camel@edumazet-glaptop3.roam.corp.google.com>
Date:   Thu, 09 Feb 2017 06:34:07 -0800
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     Gao Feng <fgao@...ai8.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [PATCH net 1/1] net: sock: Use double send/recv buff value to
 compare with max value

On Thu, 2017-02-09 at 17:08 +0800, Gao Feng wrote:
> On Thu, Feb 9, 2017 at 12:00 AM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> > On Wed, 2017-02-08 at 21:07 +0800, fgao@...ai8.com wrote:
> >> From: Gao Feng <fgao@...ai8.com>
> >>
> >> Because the value of SO_SNDBUF and SO_RCVBUF is doubled before
> >> assignment, so the real value of send and recv buffer could be more
> >> than the max sysctl config sysctl_wmem_max and sysctl_rmem_max.
> >>
> >> Now use doulbe send/recv buffer value to compare with sysctl_wmem_max
> >> and sysctl_rmem_max, and it keeps consistence with SOCK_MIN_SNDBUF
> >> and SOCK_MIN_RCVBUF.
> >>
> >> Signed-off-by: Gao Feng <fgao@...ai8.com>
> >> ---
> >
> > Looks completely bogus, based on your comprehension of this code.
> 
> It is a config param, user could config any value.
> So why give it one bogus?
> If need more, user could config it by himself.
> 
> >
> > If you need to, fix the doc, not this code.
> 
> The current codes mean the buffer could exceed the sysctl max value.
> It seems inconsistent.


Well, after your patch, we end up doubling what the user requested.

Say user used val = 20000

val = min_t(u32, val * 2, sysctl_wmem_max);

Now val is 40000.

sk->sk_sndbuf = max_t(int, val * 2, SOCK_MIN_SNDBUF);

Now sk_sndbuf is 80000, or am I missing something ?

Before your patch, sk_sndbuf was 40000. See the difference ?

Some applications carefully tuned this, some people care about
bufferbloat.

This is too late now to change this behavior, especially the way you did
it, breaking some applications.

Unless you can show me a real application that hit an issue, I will not
accept your patch.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ