rxrpc: Fix unhandled errors in rxgk_verify_packet_integrity()
authorDavid Howells <dhowells@redhat.com>
Thu, 11 Sep 2025 22:58:16 +0000 (23:58 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sun, 14 Sep 2025 20:05:22 +0000 (13:05 -0700)
commit64863f4ca4945bdb62ce2b30823f39ea9fe95415
treeaff2094d811ef79b8fe2fc2cd140038f5db0d38c
parent70d99623d5c11e1a9bcc564b8fbad6fa916913d8
rxrpc: Fix unhandled errors in rxgk_verify_packet_integrity()

rxgk_verify_packet_integrity() may get more errors than just -EPROTO from
rxgk_verify_mic_skb().  Pretty much anything other than -ENOMEM constitutes
an unrecoverable error.  In the case of -ENOMEM, we can just drop the
packet and wait for a retransmission.

Similar happens with rxgk_decrypt_skb() and its callers.

Fix rxgk_decrypt_skb() or rxgk_verify_mic_skb() to return a greater variety
of abort codes and fix their callers to abort the connection on any error
apart from -ENOMEM.

Also preclear the variables used to hold the abort code returned from
rxgk_decrypt_skb() or rxgk_verify_mic_skb() to eliminate uninitialised
variable warnings.

Fixes: 9d1d2b59341f ("rxrpc: rxgk: Implement the yfs-rxgk security class (GSSAPI)")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lists.infradead.org/pipermail/linux-afs/2025-April/009739.html
Closes: https://lists.infradead.org/pipermail/linux-afs/2025-April/009740.html
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/2038804.1757631496@warthog.procyon.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/rxrpc/rxgk.c
net/rxrpc/rxgk_app.c
net/rxrpc/rxgk_common.h