Subject: Re: [PATCH net v3 3/3] tcp: Protect accesses to .ts_recent_stamp with {READ,WRITE}_ONCE()

From: Guillaume Nault <[email-masked]>
Date: Fri, 6 Dec 2019 12:08:36 +0100

On Thu, Dec 05, 2019 at 07:50:39PM -0800, Eric Dumazet wrote:
> 
> 
> On 12/5/19 5:50 PM, Guillaume Nault wrote:
> > Syncookies borrow the ->rx_opt.ts_recent_stamp field to store the
> > timestamp of the last synflood. Protect them with READ_ONCE() and
> > WRITE_ONCE() since reads and writes aren't serialised.
> > 
> > Fixes: 264ea103a747 ("tcp: syncookies: extend validity range")
> > Signed-off-by: Guillaume Nault <[email-masked]>
> 
> Signed-off-by: Eric Dumazet <[email-masked]>
> 
> To be fair, bug was there before the patch mentioned in the Fixes: tag,
> but we probably do not care enough to backport this to very old kernels.
> 
I used this commit because it introduced the conditional in
tcp_synq_overflow(), which I believe made the lockless accesses more
dangerous than they were. But yes, the problem has been there forever.

I have to post a v4 anyway, so I'll change this tag to reference the
first commit in the tree.