From: Simon Horman <horms@kernel.org>
To: dhowells@redhat.com
Cc: Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, marc.dionne@auristor.com,
kuba@kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, linux-afs@lists.infradead.org,
linux-kernel@vger.kernel.org, stable@kernel.org
Subject: Re: [PATCH net v3 14/14] rxrpc: Remove OOB challenge/response code
Date: Mon, 20 Jul 2026 15:56:32 +0100 [thread overview]
Message-ID: <20260720145631.201053-2-horms@kernel.org> (raw)
In-Reply-To: <20260713081022.2186481-15-dhowells@redhat.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
https://sashiko.dev/#/patchset/20260713081022.2186481-8-dhowells@redhat.com?part=14
---
--- Patch [14]: [PATCH net v3 14/14] rxrpc: Remove OOB challenge/response code ---
commit fd3c68debe8844700015aad0c42af18084298daa
Author: David Howells <dhowells@redhat.com>
rxrpc: Remove OOB challenge/response code
This commit removes all the OOB communication stuff along with the UAPI
elements related to them. The reason for this is that there is no actual
limit on the capacity of the CHALLENGE queue, which could be abused
remotely, and it is not actually necessary to generate the application
data in response to the CHALLENGE.
Link: https://sashiko.dev/#/patchset/20260624163819.3017002-1-dhowells%40redhat.com
> diff --git a/include/uapi/linux/rxrpc.h b/include/uapi/linux/rxrpc.h
> index bcdfdf9c67a14..7d6a501519311 100644
> --- a/include/uapi/linux/rxrpc.h
> +++ b/include/uapi/linux/rxrpc.h
> @@ -58,11 +58,6 @@ enum rxrpc_cmsg_type {
> RXRPC_TX_LENGTH = 12, /* -s-: Total length of Tx data */
> RXRPC_SET_CALL_TIMEOUT = 13, /* -s-: Set one or more call timeouts */
> RXRPC_CHARGE_ACCEPT = 14, /* Ss-: Charge the accept pool with a user call ID */
> - RXRPC_OOB_ID = 15, /* -sr: OOB message ID */
> - RXRPC_CHALLENGED = 16, /* C-r: Info on a received CHALLENGE */
> - RXRPC_RESPOND = 17, /* Cs-: Respond to a challenge */
> - RXRPC_RESPONDED = 18, /* S-r: Data received in RESPONSE */
> - RXRPC_RESP_RXGK_APPDATA = 19, /* Cs-: RESPONSE: RxGK app data to include */
> RXRPC_RESPONSE_APPDATA = 20, /* Cs-: User key holding app data for RESPONSE */
> RXRPC__SUPPORTED
> };
[Severity: Critical]
Does removing these constants from the UAPI header violate the kernel's
policy against breaking userspace?
Any userspace program that includes linux/rxrpc.h and references the
removed RXRPC_OOB_ID or related constants will now fail to compile.
[Severity: Critical]
Can this sequence cause memory corruption and an out-of-bounds information
leak via RXRPC_RESPONSE_APPDATA?
Looking at the remaining sendmsg code in net/rxrpc/sendmsg.c, an inverted
check incorrectly rejects user keys but accepts the keyring:
net/rxrpc/sendmsg.c:rxrpc_sendmsg_cmsg() {
...
if (key_ref_to_ptr(key)->type == &key_type_user) {
key_ref_put(key);
return -EINVAL;
}
...
}
If a local user calls sendmsg with RXRPC_RESPONSE_APPDATA to attach a
keyring key, receiving a CHALLENGE packet triggers
rxgk_respond_to_challenge(), which blindly casts the keyring payload to a
user_key_payload:
net/rxrpc/rxgk.c:rxgk_respond_to_challenge() {
...
appdata = (struct user_key_payload *)
user_key_payload_rcu(conn->bundle->app_data);
if (appdata && !refcount_inc_not_zero(&appdata->ref))
...
}
This yields a pointer to name_link, and incrementing appdata->ref (at
offset 16) corrupts the keyring's keys.root pointer.
Finally, rxgk_construct_authenticator() reads datalen and data from this
corrupted offset and copies out-of-bounds kernel memory into the network
response:
net/rxrpc/rxgk.c:rxgk_construct_authenticator() {
...
a.appdata_len = htonl(appdata->datalen);
if (appdata->datalen) {
ret = skb_store_bits(response, offset, appdata->data,
appdata->datalen);
...
}
Could this allow an unprivileged user to trigger memory corruption and
kernel panic through an AF_RXRPC socket?
> diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
> index 9eb6ca3c5ebf5..9d5ce1c7ad0d2 100644
> --- a/net/rxrpc/af_rxrpc.c
> +++ b/net/rxrpc/af_rxrpc.c
[ ... ]
> @@ -710,23 +710,7 @@ static int rxrpc_setsockopt(struct socket *sock, int level, int optname,
>
> case RXRPC_MANAGE_RESPONSE:
> ret = -EINVAL;
> - if (optlen != sizeof(unsigned int))
> - goto error;
> - ret = -EISCONN;
> - if (rx->sk.sk_state != RXRPC_UNBOUND)
> - goto error;
> - ret = copy_safe_from_sockptr(&val, sizeof(val),
> - optval, optlen);
> - if (ret)
> - goto error;
> - ret = -EINVAL;
> - if (val > 1)
> - goto error;
> - if (val)
> - set_bit(RXRPC_SOCK_MANAGE_RESPONSE, &rx->flags);
> - else
> - clear_bit(RXRPC_SOCK_MANAGE_RESPONSE, &rx->flags);
> - goto success;
> + goto error;
>
> default:
> break;
[Severity: Critical]
Does this change break backwards compatibility for existing applications?
An application calling setsockopt with RXRPC_MANAGE_RESPONSE, which
previously succeeded, will now unconditionally receive -EINVAL.
> diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
> index 20c10428a50e0..1c6f4a279034f 100644
> --- a/net/rxrpc/ar-internal.h
> +++ b/net/rxrpc/ar-internal.h
[ ... ]
> @@ -310,13 +305,6 @@ struct rxrpc_security {
> bool (*validate_challenge)(struct rxrpc_connection *conn,
> struct sk_buff *skb);
>
> - /* Fill out the cmsg for recvmsg() to pass on a challenge to userspace.
> - * The security class gets to add additional information.
> - */
> - int (*challenge_to_recvmsg)(struct rxrpc_connection *conn,
> - struct sk_buff *challenge,
> - struct msghdr *msg);
> -
> /* Parse sendmsg() control message and respond to challenge. */
> int (*sendmsg_respond_to_challenge)(struct sk_buff *challenge,
> struct msghdr *msg);
[Severity: Low]
Is the sendmsg_respond_to_challenge function pointer left behind as dead
code?
It appears the OOB feature removal leaves this callback, along with
notify_oob in struct rxrpc_kernel_ops (include/net/af_rxrpc.h), the
rxrpc_skb_put_oob trace constant in include/trace/events/rxrpc.h, and dummy
implementations like none_sendmsg_respond_to_challenge() in
net/rxrpc/insecure.c.
prev parent reply other threads:[~2026-07-20 14:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 8:10 [PATCH net v3 00/14] rxrpc: Fix CHALLENGE packet handling David Howells
2026-07-13 8:10 ` [PATCH net v3 01/14] rxrpc: Fix sendmsg to not return an error if last packet queued David Howells
2026-07-13 8:10 ` [PATCH net v3 02/14] afs: Fix UAF when sending a message David Howells
2026-07-13 8:10 ` [PATCH net v3 03/14] afs: Fix afs_fs_fetch_data() to set call->async David Howells
2026-07-13 8:10 ` [PATCH net v3 04/14] rxrpc: Fix packet encryption error handling David Howells
2026-07-20 14:52 ` Simon Horman
2026-07-13 8:10 ` [PATCH net v3 05/14] rxrpc: Fix update of call->tx_pending without holding lock David Howells
2026-07-13 8:10 ` [PATCH net v3 06/14] rxrpc: Fix generation of notifications after call completion David Howells
2026-07-13 8:10 ` [PATCH net v3 07/14] afs: Simplify call refcounting David Howells
2026-07-20 14:52 ` Simon Horman
2026-07-13 8:10 ` [PATCH net v3 08/14] afs: Make afs_put_call() take trace argument David Howells
2026-07-13 8:10 ` [PATCH net v3 09/14] afs: Fix UAF in afs_make_call() David Howells
2026-07-13 8:10 ` [PATCH net v3 10/14] keys: Add refcounting to user-defined key type payload David Howells
2026-07-13 8:10 ` [PATCH net v3 11/14] afs: Create a server appdata key David Howells
2026-07-20 14:53 ` Simon Horman
2026-07-13 8:10 ` [PATCH net v3 12/14] rxrpc: Pass appdata key to rxrpc_call and thence to rxrpc_bundle David Howells
2026-07-20 14:54 ` Simon Horman
2026-07-13 8:10 ` [PATCH net v3 13/14] rxrpc: Fix CHALLENGE packet overqueuing and simplify RESPONSE generation David Howells
2026-07-20 14:54 ` Simon Horman
2026-07-13 8:10 ` [PATCH net v3 14/14] rxrpc: Remove OOB challenge/response code David Howells
2026-07-20 14:56 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260720145631.201053-2-horms@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.dionne@auristor.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox