From nobody Mon Mar 23 21:27:42 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 DE84B3B38A5 for ; Mon, 23 Mar 2026 15:05:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774278336; cv=none; b=YoOtqhZIuVajplr0v1CeJcElKWUeknIzObdE9EyqQqh31wEv2PRCbdyvREzal8ikmHJz41/oTyAHApVpYV/nAugc17un3ahT7MHp5XUk2TZGI+5aibEs7dvDesyuYsxteS5OCCYFCyeWqd5X9p8YixxqcL+dDqlqdGI5CMAlUwg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774278336; c=relaxed/simple; bh=lNi53xaZ2dGL9nGQo2Q5PUubxeSgR378CvFt6gObZgc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DH/iAaa476xte2iwE4iD2pFA3JtSdeHX/VxbNFIq/YYqVuZQnPkxpiv0KNL2N4ZA2QYpSt7pNSKi2FH3lidYZHwGil9VcGV9O9+BoyPUjhKIxH0mqWf9AHeDOZ3T5L/OuJh1v6dD/jUD+vMby6nvO4Zgq6Cg0e9MCgosqX1Y6/E= 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=TjQuIX8u; arc=none smtp.client-ip=170.10.129.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="TjQuIX8u" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774278334; 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=YaIw1S56HP9C94n6EHAzBdJx0jJ6g47etF8yPJICPVc=; b=TjQuIX8ubP/TLSCYDA8ZIbtp2dw+lxYFfLZD+JQppJ+DGdOpQV29VT5tKbAlDA8ikwaBKj V5bXRC8axsAmlL110nyy7Aku9BbVFw36cNKKI1FvM6Ck07mKWEobOiJfx/Ei1ySkW42WL2 bIFtCUAWEKZUxGg17w7g61MA+wRytYY= 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-175-FU9qcOY5NciB73N_CMT9-A-1; Mon, 23 Mar 2026 11:05:28 -0400 X-MC-Unique: FU9qcOY5NciB73N_CMT9-A-1 X-Mimecast-MFC-AGG-ID: FU9qcOY5NciB73N_CMT9-A_1774278325 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 5A3B419560BF; Mon, 23 Mar 2026 15:05:25 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.33.121]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6CE8A180075D; Mon, 23 Mar 2026 15:05:21 +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 v2 02/10] rxrpc: Fix key parsing memleak Date: Mon, 23 Mar 2026 15:04:53 +0000 Message-ID: <20260323150505.3513839-3-dhowells@redhat.com> In-Reply-To: <20260323150505.3513839-1-dhowells@redhat.com> References: <20260323150505.3513839-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.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" In rxrpc_preparse_xdr_yfs_rxgk(), the memory attached to token->rxgk can be leaked in a few error paths after it's allocated. Fix this by freeing it in the "reject_token:" case. Fixes: 0ca100ff4df6 ("rxrpc: Add YFS RxGK (GSSAPI) security class") 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c index af403f0ccab5..26d4336a4a02 100644 --- a/net/rxrpc/key.c +++ b/net/rxrpc/key.c @@ -274,6 +274,7 @@ static int rxrpc_preparse_xdr_yfs_rxgk(struct key_prepa= rsed_payload *prep, nomem: return -ENOMEM; reject_token: + kfree(token->rxgk); kfree(token); reject: return -EKEYREJECTED;