diff options
| author | David Howells <[email protected]> | 2023-05-26 11:34:54 +0000 |
|---|---|---|
| committer | Paolo Abeni <[email protected]> | 2023-05-30 08:01:06 +0000 |
| commit | 020c69c1a793ed29d28793808eddd75210c858dd (patch) | |
| tree | 8e4499c758f061207c072036b9a61abaca810362 /drivers/platform/surface/aggregator/controller.c | |
| parent | tcp: Return user_mss for TCP_MAXSEG in CLOSE/LISTEN state if user_mss set (diff) | |
| download | kernel-020c69c1a793ed29d28793808eddd75210c858dd.tar.gz kernel-020c69c1a793ed29d28793808eddd75210c858dd.zip | |
rxrpc: Truncate UTS_RELEASE for rxrpc version
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]/
Signed-off-by: David Howells <[email protected]>
Acked-by: Kenny Ho <[email protected]>
cc: Marc Dionne <[email protected]>
cc: Andrew Lunn <[email protected]>
cc: David Laight <[email protected]>
cc: "David S. Miller" <[email protected]>
cc: Eric Dumazet <[email protected]>
cc: Jakub Kicinski <[email protected]>
cc: Paolo Abeni <[email protected]>
cc: [email protected]
cc: [email protected]
Link: https://web.mit.edu/kolya/afs/rx/rx-spec [1]
Reviewed-by: Simon Horman <[email protected]>
Reviewed-by: Jeffrey Altman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'drivers/platform/surface/aggregator/controller.c')
0 files changed, 0 insertions, 0 deletions
