[PATCH net] rxrpc: Truncate UTS_RELEASE for rxrpc version

Simon Horman simon.horman at corigine.com
Sat May 27 04:59:51 PDT 2023


On Fri, May 26, 2023 at 12:34:54PM +0100, David Howells wrote:
>     
> UTS_RELEASE has a maximum length of 64 which can cause rxrpc_version to
> exceed the 65 byte message limit.
> 
> Per the rx spec[1]: "If a server receives a packet with a type value of 13,
> and the client-initiated flag set, it should respond with a 65-byte payload
> containing a string that identifies the version of AFS software it is
> running."
> 
> The current implementation causes a compile error when WERROR is turned on
> and/or UTS_RELEASE exceeds the length of 49 (making the version string more
> than 64 characters).
> 
> Fix this by generating the string during module initialisation and limiting
> the UTS_RELEASE segment of the string does not exceed 49 chars.  We need to
> make sure that the 64 bytes includes "linux-" at the front and " AF_RXRPC"
> at the back as this may be used in pattern matching.
> 
> Fixes: 44ba06987c0b ("RxRPC: Handle VERSION Rx protocol packets")
> Reported-by: Kenny Ho <Kenny.Ho at amd.com>
> Link: https://lore.kernel.org/r/20230523223944.691076-1-Kenny.Ho@amd.com/
> Signed-off-by: David Howells <dhowells at redhat.com>
> Acked-by: Kenny Ho <Kenny.Ho at amd.com>
> cc: Marc Dionne <marc.dionne at auristor.com>
> cc: Andrew Lunn <andrew at lunn.ch>
> cc: David Laight <David.Laight at ACULAB.COM>
> cc: "David S. Miller" <davem at davemloft.net>
> cc: Eric Dumazet <edumazet at google.com>
> cc: Jakub Kicinski <kuba at kernel.org>
> cc: Paolo Abeni <pabeni at redhat.com>
> cc: linux-afs at lists.infradead.org
> cc: netdev at vger.kernel.org
> Link: https://web.mit.edu/kolya/afs/rx/rx-spec [1]

Reviewed-by: Simon Horman <simon.horman at corigine.com>




More information about the linux-afs mailing list