From nobody Wed Apr 1 22:19:10 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A29E40FDA7 for ; Wed, 1 Apr 2026 10:57:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775041070; cv=none; b=S3rWzrmdmQClTz/+4wxKu6XCYpibUGRKkq3+ZFVkoxYa6YdiDEdtHE6z+9CrLcgyIoYs4SLuQ9jF1cRQOyQQrwFqcimQZ1P+Ojd04gO6hlJZ6PYX0QeJgJCy40/poFYifvSXlIBvznmH7WmqrSr8B/xWQHLKCI8jhlijqVwM1ZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775041070; c=relaxed/simple; bh=7MLTMlM7F0ak10w0E2LplrY8tvTboOdFeE2eoMmUNUM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E/30WfspQ2vEQg/fyliITFqzUZpj1FKjBWZelR8VMi6GMFnjCbf2WJZDyB76wlkJoFZ7/yaVjKVFEUD2MtmZ0NfcHwEpnK1jlCSygdHCg/huXm8ENmaHzoRAQLcGvYbdtoZbdexeck75PudSzema9LhlNz4B7iBcEvMl6cXqP6k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=c2GO0tCB; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="c2GO0tCB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775041063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KppfArEcP/QUXz58nWtzKdGZYsRDSnk43Kui514i9+Q=; b=c2GO0tCB7egFyBI9n//oN+TppvfQ1iJa/zs3Aye2z44F0HiV0OSV1rS/VYx1Ook8p5updq Sexr8t0Qo49LU/xmse/m5VC80XMMuFqZPpWoVhrMfbJguVFFX9q+iuIZjj7Vv0XNoBI1zr JtzEGSQEBkPTiZ0NoS4y1KaDSh2Z/yQ= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-352-VupY1O3zNxKC3hBNVmvdzQ-1; Wed, 01 Apr 2026 06:57:41 -0400 X-MC-Unique: VupY1O3zNxKC3hBNVmvdzQ-1 X-Mimecast-MFC-AGG-ID: VupY1O3zNxKC3hBNVmvdzQ_1775041058 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9EE7F195608B; Wed, 1 Apr 2026 10:57:38 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.35.245]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E16581953947; Wed, 1 Apr 2026 10:57:32 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , Marc Dionne , Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, Yuqi Xu , Yifan Wu , Juefei Pu , Yuan Tan , Xin Liu , Ren Wei , Ren Wei , Simon Horman , stable@kernel.org Subject: [PATCH net v4 12/15] rxrpc: reject undecryptable rxkad response tickets Date: Wed, 1 Apr 2026 11:56:05 +0100 Message-ID: <20260401105614.1696001-13-dhowells@redhat.com> In-Reply-To: <20260401105614.1696001-1-dhowells@redhat.com> References: <20260401105614.1696001-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" From: Yuqi Xu rxkad_decrypt_ticket() decrypts the RXKAD response ticket and then parses the buffer as plaintext without checking whether crypto_skcipher_decrypt() succeeded. A malformed RESPONSE can therefore use a non-block-aligned ticket length, make the decrypt operation fail, and still drive the ticket parser with attacker-controlled bytes. Check the decrypt result and abort the connection with RXKADBADTICKET when ticket decryption fails. Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by u= serspace and kernel both") Reported-by: Yifan Wu Reported-by: Juefei Pu Co-developed-by: Yuan Tan Signed-off-by: Yuan Tan Suggested-by: Xin Liu Tested-by: Ren Wei Signed-off-by: Yuqi Xu Signed-off-by: Ren Wei Signed-off-by: David Howells cc: Marc Dionne cc: Eric Dumazet cc: "David S. Miller" cc: Jakub Kicinski cc: Paolo Abeni cc: Simon Horman cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.org cc: stable@kernel.org --- net/rxrpc/rxkad.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index e923d6829008..0f79d694cb08 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c @@ -958,6 +958,7 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection= *conn, struct in_addr addr; unsigned int life; time64_t issue, now; + int ret; bool little_endian; u8 *p, *q, *name, *end; =20 @@ -977,8 +978,11 @@ static int rxkad_decrypt_ticket(struct rxrpc_connectio= n *conn, sg_init_one(&sg[0], ticket, ticket_len); skcipher_request_set_callback(req, 0, NULL, NULL); skcipher_request_set_crypt(req, sg, sg, ticket_len, iv.x); - crypto_skcipher_decrypt(req); + ret =3D crypto_skcipher_decrypt(req); skcipher_request_free(req); + if (ret < 0) + return rxrpc_abort_conn(conn, skb, RXKADBADTICKET, -EPROTO, + rxkad_abort_resp_tkt_short); =20 p =3D ticket; end =3D p + ticket_len;