Netdev List
 help / color / mirror / Atom feed
From: Andrew Stellman <bugs@stellman-greene.com>
To: David Howells <dhowells@redhat.com>,
	Marc Dionne <marc.dionne@auristor.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	linux-afs@lists.infradead.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net-next] rxrpc: Reject unsecured calls to userspace services with a minimum level
Date: Thu, 26 Nov 2026 17:41:37 -0500	[thread overview]
Message-ID: <20261126224137.55862-1-bugs@stellman-greene.com> (raw)

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,

                 reply	other threads:[~2026-11-26 22:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261126224137.55862-1-bugs@stellman-greene.com \
    --to=bugs@stellman-greene.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --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 \
    /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