From nobody Wed Apr 1 22:19:12 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 064E53F880A for ; Wed, 1 Apr 2026 10:56:39 +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=1775041001; cv=none; b=QdDG8eo4YJVdSyvaGMC9+IRzdm/ZJWzyWQIUG2wiMEvNumHJYrTFje58quV3g0ZVLh4+pFWbebiHSto1Or+fj5OGp+gIhBzAXsfgUDrrlRzvmS8MQrO0d3V6RlW55v9J39pNHhKxCFNd6B1IjnhvvoA6OUyStWDvwrUl4Cd6s7Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775041001; c=relaxed/simple; bh=lb0GZ4LjZYME6LIEZSDsoau/6K8K5XJGRSMiunj2zEc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OWEp/vdyNRkgIJmdcnSjsHBO3Bcy3/0Y/D5i1vao8BInspW6rT/uDectqHiQPGUcALqPdJGoF/JYkubP5kHfgZanOpKN7COFcr7tZPM2ji4vstTGKERbuxeOp3ZWpzjngq+fyX2+c+V3WdEGHCtaGIbU2xAu1X8dUWWstrTNnXM= 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=ANV9BiVe; 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="ANV9BiVe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775040999; 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=hXfYTLAZKbXpNf47trMTcMM/l7RhE1yxWdNYJ5ar7ck=; b=ANV9BiVe27ttA0UtEUcGaT9w8OX9Z8qbzwrY91d63CNU8Wu0IJbQrKhYlNZzx3oj/+cSxo lWloF1D9OLZNXNagzAePnWF9WE1bfB9KOGKKBzrYZV36lSjbb+Z29HBpfFU/4HWNfQZLhw N+S1B5SmIRRF3NnxL8TTZw4TLK2c2uE= Received: from mx-prod-mc-05.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-678-tJS9f5olMBCBH5_c97W0wA-1; Wed, 01 Apr 2026 06:56:36 -0400 X-MC-Unique: tJS9f5olMBCBH5_c97W0wA-1 X-Mimecast-MFC-AGG-ID: tJS9f5olMBCBH5_c97W0wA_1775040994 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8E6291956089; Wed, 1 Apr 2026 10:56:34 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.35.245]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8542E19560AB; Wed, 1 Apr 2026 10:56:30 +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, Jeffrey Altman , Simon Horman , stable@kernel.org Subject: [PATCH net v4 01/15] rxrpc: Fix key quota calculation for multitoken keys Date: Wed, 1 Apr 2026 11:55:54 +0100 Message-ID: <20260401105614.1696001-2-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.12 Content-Type: text/plain; charset="utf-8" In the rxrpc key preparsing, every token extracted sets the proposed quota value, but for multitoken keys, this will overwrite the previous proposed quota, losing it. Fix this by adding to the proposed quota instead. Fixes: 8a7a3eb4ddbe ("KEYS: RxRPC: Use key preparsing") Closes: https://sashiko.dev/#/patchset/20260319150150.4189381-1-dhowells%40= redhat.com Signed-off-by: David Howells cc: Marc Dionne cc: Jeffrey Altman 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/key.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c index 85078114b2dd..af403f0ccab5 100644 --- a/net/rxrpc/key.c +++ b/net/rxrpc/key.c @@ -72,7 +72,7 @@ static int rxrpc_preparse_xdr_rxkad(struct key_preparsed_= payload *prep, return -EKEYREJECTED; =20 plen =3D sizeof(*token) + sizeof(*token->kad) + tktlen; - prep->quotalen =3D datalen + plen; + prep->quotalen +=3D datalen + plen; =20 plen -=3D sizeof(*token); token =3D kzalloc_obj(*token); @@ -199,7 +199,7 @@ static int rxrpc_preparse_xdr_yfs_rxgk(struct key_prepa= rsed_payload *prep, } =20 plen =3D sizeof(*token) + sizeof(*token->rxgk) + tktlen + keylen; - prep->quotalen =3D datalen + plen; + prep->quotalen +=3D datalen + plen; =20 plen -=3D sizeof(*token); token =3D kzalloc_obj(*token); @@ -460,6 +460,7 @@ static int rxrpc_preparse(struct key_preparsed_payload = *prep) memcpy(&kver, prep->data, sizeof(kver)); prep->data +=3D sizeof(kver); prep->datalen -=3D sizeof(kver); + prep->quotalen =3D 0; =20 _debug("KEY I/F VERSION: %u", kver); =20 @@ -497,7 +498,7 @@ static int rxrpc_preparse(struct key_preparsed_payload = *prep) goto error; =20 plen =3D sizeof(*token->kad) + v1->ticket_length; - prep->quotalen =3D plen + sizeof(*token); + prep->quotalen +=3D plen + sizeof(*token); =20 ret =3D -ENOMEM; token =3D kzalloc_obj(*token);