Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] rxrpc: Reject unsecured calls to userspace services with a minimum level
@ 2026-11-26 22:41 Andrew Stellman
  0 siblings, 0 replies; only message in thread
From: Andrew Stellman @ 2026-11-26 22:41 UTC (permalink / raw)
  To: David Howells, Marc Dionne
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, linux-afs, netdev, linux-kernel

From: Andrew Stellman <astellman@stellman-greene.com>

rxrpc_get_incoming_security() doesn't check rx->min_sec_level, so a
userspace service socket that sets RXRPC_MIN_SECURITY_LEVEL above
RXRPC_SECURITY_PLAIN still accepts incoming calls with security index
RXRPC_SECURITY_NONE.

Refuse security index NONE in that case. Kernel sockets are skipped,
because kAFS and rxperf set RXRPC_SECURITY_ENCRYPT on the kernel sockets
they serve on. This changes behaviour for a userspace service that sets
the minimum and relies on unsecured incoming calls being accepted.

Tested in an arm64 QEMU guest built from mainline 9437ee8b6cf6, as uid
1000 with no capabilities: a service socket with the minimum set to
RXRPC_SECURITY_ENCRYPT received an unsecured call over loopback without
this patch, and with it didn't receive the call within four seconds. A
service with no minimum received the call in both cases.

The issue was found by Claude Fable 5.2 and Claude Opus 5.5 running
Quality Playbook, an LLM-driven code review tool:
https://github.com/andrewstellman/quality-playbook
The fix was drafted with OpenAI GPT-6 (Codex) and this changelog with
Claude Opus 5.5, and both were reviewed by me.

Signed-off-by: Andrew Stellman <astellman@stellman-greene.com>
---
This only covers security index NONE. I didn't test rxkad or rxgk, but
nothing in them reads rx->min_sec_level, so calls secured below the
minimum look like they would still be accepted. I can send a v2 that
enforces the minimum for those too, or a documentation patch if the
option is meant for client calls only.

A reproducer is available on request.

 net/rxrpc/security.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/rxrpc/security.c b/net/rxrpc/security.c
index 2bfbf2b2bb37a..52015c73c583c 100644
--- a/net/rxrpc/security.c
+++ b/net/rxrpc/security.c
@@ -138,6 +138,11 @@ const struct rxrpc_security *rxrpc_get_incoming_security(struct rxrpc_sock *rx,
 
 	_enter("");
 
+	if (sp->hdr.securityIndex == RXRPC_SECURITY_NONE &&
+	    rx->min_sec_level > RXRPC_SECURITY_PLAIN &&
+	    !rx->sk.sk_kern_sock)
+		return NULL;
+
 	sec = rxrpc_security_lookup(sp->hdr.securityIndex);
 	if (!sec) {
 		rxrpc_direct_conn_abort(skb, rxrpc_abort_unsupported_security,

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-26 22:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 22:41 [PATCH net-next] rxrpc: Reject unsecured calls to userspace services with a minimum level Andrew Stellman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox