]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
rxrpc: Fix generation of serial numbers to skip zero
authorDavid Howells <dhowells@redhat.com>
Fri, 2 Feb 2024 15:19:13 +0000 (15:19 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Feb 2024 12:34:06 +0000 (12:34 +0000)
commitf31041417bf7f4a4df8b3bfb52cb31bbe805b934
treee2533e779d6314b4dfb17360a92d7b0fe88207e6
parentfdeba0b57d61b40a708de361294fde3e1495588d
rxrpc: Fix generation of serial numbers to skip zero

In the Rx protocol, every packet generated is marked with a per-connection
monotonically increasing serial number.  This number can be referenced in
an ACK packet generated in response to an incoming packet - thereby
allowing the sender to use this for RTT determination, amongst other
things.

However, if the reference field in the ACK is zero, it doesn't refer to any
incoming packet (it could be a ping to find out if a packet got lost, for
example) - so we shouldn't generate zero serial numbers.

Fix the generation of serial numbers to retry if it comes up with a zero.

Furthermore, since the serial numbers are only ever allocated within the
I/O thread this connection is bound to, there's no need for atomics so
remove that too.

Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Eric Dumazet <edumazet@google.com>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: linux-afs@lists.infradead.org
cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rxrpc/ar-internal.h
net/rxrpc/conn_event.c
net/rxrpc/output.c
net/rxrpc/proc.c
net/rxrpc/rxkad.c