🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23764

Re: [PATCH net-next] rxrpc: Reject unsecured calls to userspace services with a minimum level

#23764
From: netdev-bot+sashiko
Date: Fri, 27 Nov 2026 23:24
174 lines
14126 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 1 · Low: 2

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] The fix is incomplete.
- [Medium] After this patch, RXRPC_MIN_SECURITY_LEVEL means different
  things depending on rx->sk.sk_kern_sock, and the documentation does…
- [Low] The new reject path in rxrpc_get_incoming_security() returns NULL
  without calling rxrpc_direct_conn_abort() with its own reason.
- [Low] The commit is described as a fix for a security-policy bug (a
  service minimum security level that is not enforced for unsecured…

--

rxrpc: Reject unsecured calls to userspace services with a minimum level

This patch makes rxrpc_get_incoming_security() refuse incoming calls with
security index RXRPC_SECURITY_NONE when a userspace service socket has set
RXRPC_MIN_SECURITY_LEVEL above RXRPC_SECURITY_PLAIN. Kernel sockets are
exempted, because kAFS and rxperf set RXRPC_SECURITY_ENCRYPT on the sockets
they serve on.

> Signed-off-by: Andrew Stellman <astellman@stellman-greene.com>

[Severity: Low]
This isn't a bug, but should this have a Fixes: tag? The changelog
describes the patch as a fix for a security policy bug.

The patch also deliberately changes behaviour for existing userspace
services. Could the changelog say whether it is meant for stable?

> 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 &&

[Severity: High]
The commit message gives the root cause as:

  rxrpc_get_incoming_security() doesn't check rx->min_sec_level

This check only covers security index NONE, though. Will a userspace
service socket with RXRPC_MIN_SECURITY_LEVEL set to RXRPC_SECURITY_ENCRYPT
still accept rxkad or rxgk calls negotiated at a lower level?

In rxkad_verify_response(), the level comes from the client's RESPONSE
packet. It only gets an upper bound check:

net/rxrpc/rxkad.c:rxkad_verify_response() {
    ...
	level = ntohl(response->encrypted.level);
	if (level > RXRPC_SECURITY_ENCRYPT) {
		...
	}
	conn->security_level = level;
    ...
}

rxgk_verify_response() does the same thing with the token level:

net/rxrpc/rxgk.c:rxgk_verify_response() {
    ...
	conn->security_level = token->rxgk->level;
    ...
}

Neither of these compares the level against rx->min_sec_level. Apart
from the setters and this new check, min_sec_level is only read in the
client call setup paths, rxrpc_kernel_begin_call() and
rxrpc_new_client_call_for_sendmsg().

An authenticated client could answer the CHALLENGE with level
RXRPC_SECURITY_PLAIN or RXRPC_SECURITY_AUTH. Its calls would then reach a
service that requires ENCRYPT. At PLAIN level the data has no integrity
protection either.

That seems to contradict Documentation/networking/rxrpc.rst, which
describes the option as "the minimum security level required for calls
on this socket".

The gap is only mentioned below the --- line, so the note won't end up
in git history. Should the negotiated level also be checked where the
connection gets secured, in rxkad_verify_response() and the rxgk verify
path?

> +	    !rx->sk.sk_kern_sock)

[Severity: Medium]
With this exemption, RXRPC_MIN_SECURITY_LEVEL means different things
depending on sk_kern_sock. Is that split meant to be documented?

For userspace service sockets, the option now also rejects incoming
NONE calls.

For kernel sockets that use rxrpc_sock_set_min_security_level(), it is
still only the level used for outgoing client calls:

net/rxrpc/sendmsg.c:rxrpc_new_client_call_for_sendmsg() {
    ...
	cp.security_level	= rx->min_sec_level;
    ...
}

The in-tree kernel users already depend on this client-only meaning.
afs_open_socket() sets ENCRYPT on the CM service socket, and that socket
must accept unsecured fileserver callbacks:

fs/afs/rxrpc.c:afs_open_socket() {
    ...
	ret = rxrpc_sock_set_min_security_level(socket->sk,
						RXRPC_SECURITY_ENCRYPT);
    ...
}

rxperf does the same.

Documentation/networking/rxrpc.rst uses the same words for the sockopt
and for rxrpc_sock_set_min_security_level(): "the minimum security level
required for calls on this socket". It doesn't cover the new service
side enforcement or the kernel socket exemption.

A userspace program built like kAFS uses one socket to make encrypted
client calls and to accept unsecured callbacks. With this patch, its
incoming calls will be aborted.

It could bind a separate client socket to the same transport address as
a workaround. Existing programs would still break with no indication of
why.

Should Documentation/networking/rxrpc.rst be updated to describe this
behaviour?

> +		return NULL;

[Severity: Low]
The other two NULL returns in rxrpc_get_incoming_security() call
rxrpc_direct_conn_abort() with their own reason, but this one doesn't.
Will this rejection be traced as rxrpc_abort_service_not_offered?

The caller falls through to this code:

net/rxrpc/call_accept.c:rxrpc_new_incoming_call() {
    ...
unsupported_security:
	read_unlock_irq(&local->services_lock);
	return rxrpc_direct_conn_abort(skb, rxrpc_abort_service_not_offered,
				       RX_INVALID_OPERATION, -EKEYREJECTED);
    ...
}

So trace_rxrpc_abort reports "service not offered" even though the
service is bound and listening. The peer gets a generic
RX_INVALID_OPERATION abort.

This fallback in rxrpc_new_incoming_call() also overwrites the abort
codes set by the existing NULL paths in rxrpc_get_incoming_security().
That part is older than this patch.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126224137.55862-1-bugs%40stellman-greene.com
Technical Details
Message-ID: <179582184048.3135.8278153392391816452@kernel.org>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372978-linux-kernel-netdev=dewy.ru
References: <20261126224137.55862-1-bugs@stellman-greene.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372978-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next] rxrpc: Reject unsecured calls to userspace
 services with a minimum level
Date: Fri, 27 Nov 2026 23:24:00 +0000
Organization: Usenet Network
Message-ID: <179582184048.3135.8278153392391816452@kernel.org>
References: <20261126224137.55862-1-bugs@stellman-greene.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="841574"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:1tqBois7AceRjMw3LKMgqfUka9M= sha256:3xX7achU5352gaGc08HxQdIH3fLK2eUUTekQ1Z1ZFVQ=
	sha1:sqcFMOEivtY2xin7x4vOm4V8p/s= sha256:qDYcMAg66pco1mA4/xt3Vqj/FQtNiXSjV5Co63+tZ14=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 03941125F69; Sat, 28 Nov 2026 02:24:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id bTKk4n0mWyGi;
	Sat, 28 Nov 2026 02:24:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372978-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 48945125DC5; Sat, 28 Nov 2026 02:24:06 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 672BC2BB9F; Fri, 27 Nov 2026 23:24:03 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795821843;
	b=sNavTuozThowV61T1DFrnnyxpVpaCeSfiCjjGDqFRarfbeQR2nLVv7J3TMR5Drhy2X37
	 8C94ZX33C6ZCKk0vo2NUvhqyXiZp3dnOsIPU2FzZu6X80EtDeCXQ3Ig6EimpJIOEcKiXl
	 Yc0NQjcIMttMgPCTQeF9QcWA1e6U/Mms1CfuXuobwslyWD+K3E2/JXj8pyPLPkG2VtZuB
	 5QDKLauFGf0wxmkpfjc1qsQ5LC+ZPk2UJ235/aWbbS6EnQLDXpc+qImG2NHT2qLC6YCJv
	 v18UZUz9COy2lC0oVZGoMUlg30sXXRC3zBSkAyQcfbZYor+Eum6w2tbmYMcojMnrh0w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795821843;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=tr+ptdFAOHmNGIVwaASfOid//+Rw4qYWo/QDPFKYOHw=;
	b=CQVsvidYwtrNhi6KZLVBcT79zzBLcRLO3t/E/5Bq26r6jytT7Z4YfjQ26AZqrKt3DW9i
	 +eTWuBbP9mqjFbKL9JqcLPypQZOwIk9P0DyYFtsfdoDtIPXufyK2+HO7lcP/kApWJWYrv
	 7cGn31qWRNE/fjNbeThBHSdOabWYKtn4TM7QQCAyMvKWhp82W6ICNIq0VnRR3w9CalsRG
	 c1G6O8CsORyE2EDattXZoLSEj/kFc0xBxDYSSMIVwLsTcTI+9qjskyl21SnC27sx4FlLb
	 wx7BZNIR9kdIaGJpKOERJ8G9PhHa6yYHovJdTuFy2pvXMdO2NpXIiIXp3W9nYkK0esg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NrwafniQ;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id E003B606A32F;
	Fri, 27 Nov 2026 23:24:02 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NrwafniQ
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795821842;
	b=dOBvpHFQmUFrTJLNMHPdBHv9tR05fuK0XwTgzjpWQ0MwFlp/+k2cVfO2rTKxIn6fIOBN
	 ABaSBkWFVf5jxDiR1huSpfLR9DJeOuB6KlWTA/642dWSO6s/Wae4S0exyEtXnWlHnvMQI
	 8apbuTuIhHuz9OUV7ZZo6yLpSblzp84a7Pb/19Kg2n3FD18PLOJNO6HKO2TOkb4v/ojyy
	 H+ggRsoh6T0MfZi6Y4mT/Mheoy9YVp2JfxY3LgHMjMMMtkrL391Ng8pDNrbqZPywMtyIr
	 ZRb6AkSz882LPbNplsBc11WsLUAxvOKKvIrKF06FuX3h89ep6YH+JEP614rQjuXbL9w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795821842;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=tr+ptdFAOHmNGIVwaASfOid//+Rw4qYWo/QDPFKYOHw=;
	b=TheLE8TTpBHIXRCqh7GKJrNg4PUOjTFokx1zgZTjLwmyB5tb+Sn51ShbAdEG1xlZHeN1
	 UEJEc5MxXeR4vxiamRzwkrBRRldZrDT8d8Oua51+pF88g7bJ9DsgvtlCakQJVweMFeME7
	 000X3fP4OU7M2EI2/b4YvbPRElpK2EaNd2OLQtPof9dxdwVzA1oMY5V6nd3HnVtyqGp0c
	 aGiFundEJZkYQssfahjMWVQuFM6GDdFfv2Rv0StRcyFwBBi3zw9NyIXuGVyVuCnZOKokL
	 YHoOm+8ornKEXHhWN8W6JdjGy85X0pSJ+8NNvvmq5Y4Dj66Ov8DuaE7ZWswBAT1zgRA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NrwafniQ;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B3BD606A31E;
	Fri, 27 Nov 2026 23:24:01 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E702C1F00899;
	Fri, 27 Nov 2026 23:24:00 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795821841;
	bh=tr+ptdFAOHmNGIVwaASfOid//+Rw4qYWo/QDPFKYOHw=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=NrwafniQmUNQ91WV8B0N3prb+CnnuIl4xRxkTgXMZcXQ4dUYEPGwtZF/Iv/U/2IAb
	 ug/SqFVMdiC+70zOMsuyoa/Xx++Wug1O/2pR2WPeLlrgVimGJyfXBjEUq0FB8kzim6
	 HmU33JcVCZezX5VQxcXhijbrgdD4ZbyGjyyc1gvHbhqYOng9j2n3SEsl7IPXtLLP6W
	 KsGzdK5P8zPTKnpi4bt5TORRavWRv/Ic7g8JQb41O+lMU3tfm1znZlNVUoWZO84mD/
	 0p7/KzUqz+1fa5Dt9JqrP5getFOFK26mQvFacasxmXS0Q6hTTWy2PqYB+A5Isd36gl
	 4S3KXVXwAx96g==
X-Cc: dhowells@redhat.com, marc.dionne@auristor.com, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
 linux-afs@lists.infradead.org, netdev@vger.kernel.org,
 linux-kernel@vger.kernel.org
X-In-Reply-To: <20261126224137.55862-1-bugs@stellman-greene.com>
X-sashiko-severity: High
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list