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]
Message-ID: <CANn89iL8bkiJdDH110U5uD4mSJM7v9fU8xFa9BXAu4wCf+y13Q@mail.gmail.com>
Date:   Thu, 10 Jun 2021 12:04:37 +0200
From:   Eric Dumazet <edumazet@...gle.com>
To:     Shuyi Cheng <chengshuyi@...ux.alibaba.com>
Cc:     David Miller <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        David Ahern <dsahern@...nel.org>,
        netdev <netdev@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org,
        Mao Wenan <wenan.mao@...ux.alibaba.com>
Subject: Re: [PATCH net-next] net: tcp: Updating MSS, when the sending window
 is smaller than MSS.

On Thu, Jun 10, 2021 at 8:00 AM Shuyi Cheng
<chengshuyi@...ux.alibaba.com> wrote:

> Thank you very much for your reply!
>
> Maybe it's not clear enough that I described it. The scenario where the
> above problem occurs is precisely because the tcp server sets the size
> of RCVBUFF to be smaller after the connection is established. Here is a
> sample code that caused the problem.
>
> # default tcp_rmem is 87380

Except that this value is overridden at connection establishment.

tcp_rmem[1] is only a floor value, say if you want a reasonable value
even if MSS == 100

> tcpServerSocket= socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> tcpServerSocket.bind(server_addr)
> tcpServerSocket.listen()
> while True:
>      connection,client_addr = tcpServerSocket.accept()
>      # Shrink rmem
>      connection.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 16*1024)
>
> Therefore, when the developer calls the sock_setsockopt function to
> reset RCVBUF, we can use sock to determine the TCP state. When in the
> connected state, it is not allowed to set RCVBUF smaller than mss.
>

Sure, but the application can _also_ set SO_RCVBUF before listen() or connect()

We can not have assumptions about SO_RCVBUF values and socket states.
Otherwise we would have to add some sk_rcvbuf adjustments every time
the socket state is changed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ