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: <CAL+tcoC_H+w5ExeL-9jbmkNHLRYEhR=+H9sV+X7VpYOsvaxdOw@mail.gmail.com>
Date: Thu, 3 Oct 2024 19:48:48 +0900
From: Jason Xing <kerneljasonxing@...il.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, 
	Paolo Abeni <pabeni@...hat.com>, Neal Cardwell <ncardwell@...gle.com>, netdev@...r.kernel.org, 
	eric.dumazet@...il.com
Subject: Re: [PATCH net-next 3/3] tcp: add a fast path in tcp_delack_timer()

On Thu, Oct 3, 2024 at 6:11 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Thu, Oct 3, 2024 at 1:19 AM Jason Xing <kerneljasonxing@...il.com> wrote:
> >
> > Hello Eric,
> >
>         !READ_ONCE(tcp_sk(sk)->compressed_ack))
> >
> > I wonder what the use of single READ_ONCE() is here without a
> > WRITE_ONCE() pair? It cannot guarantee that the result of reading
> > compressed_ack is accurate. What if we use without this READ_ONCE()
> > here?
>
> Have you read the changelog and comments about this 'accuracy' thing ?

My initial question was about how only READ_ONCE works without adding
corresponding WRITE_ONCE here. Sorry that I didn't totally understand
it.

Sure, I did read them. But I did miss to understand one line "before
acquiring the socket spinlock reduces acquisition time and chances of
contention", which is perhaps the reason.

>
> If you do not use the READ_ONCE() here, only concern is KCSAN might
> trigger a splat.
>
> The WRITE_ONCE() for a single byte is not needed, no tearing is possible.

Yes, I got it. The writers of this field before this patch are all
protected under the socket lock.

Thanks for your explanation.

Thanks,
Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ