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>] [day] [month] [year] [list]
Date:   Thu, 16 Dec 2021 04:18:16 -0800
From:   Eric Dumazet <edumazet@...gle.com>
To:     "clementwei90@...il.com" <clementwei90@...il.com>
Cc:     Alexey Kuznetsov <kuznet@....inr.ac.ru>,
        Arnd Bergmann <arnd@...db.de>,
        David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
        weirongguang@...inos.cn, liuyun01@...inos.cn, xiaolinkui@...inos.cn
Subject: Re: Question about cca9bab1b72cd patch

On Wed, Dec 15, 2021 at 6:20 PM clementwei90@...il.com
<clementwei90@...il.com> wrote:
>
> hello:
> I have a question in patch cca9bab1b72cd ("tcp: use monotonic timestamps for PAWS").
> In net/ipv4/tcp_ipv4.c file, before the patch, it was "get_seconds() - tcptw->tw_ts_recent_stamp > 1",
> now it become "time_after32(ktime_get_seconds(), tcptw->tw_ts_recent_stamp)".
> Before the patch, the judgment conditions is that the time difference must greater than 1,
> means that the socket port reuse after 2 seconds. Now the conditions is became greater than 0,
> meas it will reuse within 2 seconds. It make difference in tcp_tw_reuse option and it not explained in the patch description.
> Why do it like this?Does it modify the original logic to make the socket port reuse faster?
> What is the standard in tcp_tw_reuse?
>

If you really care [1], please provide RFC on which this logic is based on.

I say that new code is just fine, and would allow better reuse.

If precise sub-second timing was needed, I guess we would have used
jiffies based tstamp.

[1] By default, tw_reuse is only enabled on loopback.
Applications relying on it should really move on to something else in
our century.

Thank you.


> ---Original---
> From: "clement wei"<clementwei90@...il.com>
> Date: Tue, Dec 14, 2021 09:13 AM
> To: "Alexey Kuznetsov"<kuznet@....inr.ac.ru>;
> Cc: "Arnd Bergmann"<arnd@...db.de>;"Eric Dumazet"<edumazet@...gle.com>;"David Miller"<davem@...emloft.net>;
> Subject: Re: Question about cca9bab1b72cd patch
>
> Thank you. But I am confused that in > 1, means that the socket port
> reuse after 2 seconds, now the > 0 meas it will reuse within 2
> seconds.
> What is the standard in tcp_tw_reuse?
>
> Alexey Kuznetsov  于2021年12月13日周一 22:52写道:
> >
> > On Mon, Dec 13, 2021 at 8:48 PM Arnd Bergmann  wrote:
> > > FWIW, here is the original commit that introduced the '> 1':
> > >
> > > https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/net/ipv4/tcp_ipv4.c?h=v2.5.8&id=b8439924316d5bcb266d165b93d632a4b4b859af
> >
> > Sorry, I cannot tell after so long time. :-)
> >
> > Most likely, > 1 was a mistake, probably coming from worries that > 0 does
> > not mean that some time has passed. But anyway logic of timestamps
> > does not require that any time actually passed, it is enough that new
> > timestamps are all later than ones sent before. So, time_after32() looks right.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ