From nobody Thu Apr 2 22:05:15 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 B5023345741 for ; Thu, 26 Mar 2026 13:19:48 +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=1774531190; cv=none; b=XxAe6IhrC6vXXcCHL2pwE6PUJ/ii4qt59ijoX5hMIWbcEFA9RJAeHCumWNYnrxPL3wrLJ83C63cWVSBUnXG/iZHoJ9Us9LiN517CKQbGxCj0buW/kGgPC7RvhM1kuDw+9i1QVr/KaxnvqSdhlWwzOsenxuo46MJpYRET4uPv+S0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774531190; c=relaxed/simple; bh=+qHAnkIsqP997RWJ6s4umVeu9sIbTOhEQRZ3NRgBWrs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B40cNHepJKNBgfEzW6FnO0FqTNzXuODypKY7pB71DHfihU2zjdoAOa/0+LMm8DpoNywNS+ajInlaWnFHpx0t5Q5Vney+miRMHDkixpNAh2yBKwDoSM347RgGRC0hAQ12NPJVmwo/cemvn1BsR1v/E1XSWr+EqwRUQhkaqr4Qlx8= 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=LouZU8jK; 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="LouZU8jK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774531187; 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=VeYaAx0dAJ4NEayyI0atPURUWeMa5ddyG3Tx/cyMm4w=; b=LouZU8jKO0jIMEpIUW0OWEewrqeboRtaUfKmbC3VDyRJtIWkouG9wAA0JhZpfUICkotN0j 2pPpXsb7NXKL0gVod1mI5h0RH79X0RaEzv6gK0l/8I7psjyFDP2v5B3zkB9Eht76OHxY/v 3gFQoSb7LHf0S9l4HYlSUdBSf3czBNE= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-148-mf5e_e9wNH2B5oLOLo3mAw-1; Thu, 26 Mar 2026 09:19:42 -0400 X-MC-Unique: mf5e_e9wNH2B5oLOLo3mAw-1 X-Mimecast-MFC-AGG-ID: mf5e_e9wNH2B5oLOLo3mAw_1774531180 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9F23118002EE; Thu, 26 Mar 2026 13:19:40 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.33.121]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5197E1955D84; Thu, 26 Mar 2026 13:19:36 +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, Anderson Nascimento , Jeffrey Altman , Simon Horman , stable@kernel.org Subject: [PATCH net v3 10/11] rxrpc: Fix key reference count leak from call->key Date: Thu, 26 Mar 2026 13:18:35 +0000 Message-ID: <20260326131838.634095-11-dhowells@redhat.com> In-Reply-To: <20260326131838.634095-1-dhowells@redhat.com> References: <20260326131838.634095-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: Anderson Nascimento When creating a client call in rxrpc_alloc_client_call(), the code obtains a reference to the key. This is never cleaned up and gets leaked when the call is destroyed. Fix this by freeing call->key in rxrpc_destroy_call(). Before the patch, it shows the key reference counter elevated: $ cat /proc/keys | grep afs@54321 1bffe9cd I--Q--i 8053480 4169w 3b010000 1000 1000 rxrpc afs@54321: ka $ After the patch, the invalidated key is removed when the code exits: $ cat /proc/keys | grep afs@54321 $ Fixes: f3441d4125fc ("rxrpc: Copy client call parameters into rxrpc_call ea= rlier") Signed-off-by: Anderson Nascimento Co-developed-by: David Howells Signed-off-by: David Howells Reviewed-by: Jeffrey Altman 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/call_object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c index 0e47751d5937..57c15aa1e9b5 100644 --- a/net/rxrpc/call_object.c +++ b/net/rxrpc/call_object.c @@ -694,6 +694,7 @@ static void rxrpc_destroy_call(struct work_struct *work) rxrpc_put_bundle(call->bundle, rxrpc_bundle_put_call); rxrpc_put_peer(call->peer, rxrpc_peer_put_call); rxrpc_put_local(call->local, rxrpc_local_put_call); + key_put(call->key); call_rcu(&call->rcu, rxrpc_rcu_free_call); }