Re: [syzbot] [afs?] [net?] KCSAN: data-race in rxrpc_peer_keepalive_worker / rxrpc_send_data_packet

From: Eric Dumazet
Date: Thu Jan 08 2026 - 09:01:43 EST


On Thu, Jan 8, 2026 at 2:42 PM David Howells <dhowells@xxxxxxxxxx> wrote:
>
> I think that this shouldn't be a problem. The write is:
>
> conn->peer->last_tx_at = ktime_get_seconds();
>
> and the read is:
>
> keepalive_at = peer->last_tx_at + RXRPC_KEEPALIVE_TIME;
>
> an approximate time is fine as we're estimating when to send a keepalive
> packet if we haven't transmitted a packet in a while.

LGTM, but potential load and store tearing should be avoided, using
READ_ONCE() and WRITE_ONCE().

last_tx_at being time64_t, this would still be racy on 32bit arches.

last_tx_at could probably be an "unsigned long" (in jiffies units)...