From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 495E3499F0C; Wed, 9 Sep 2026 14:25:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788963919; cv=none; b=gkITdVHPoPHtXSN9O023sgWrrBBrVjg4g5bCbCLvElV8vXXQAsc66SQk8BSSIC1vP8Nfd1aFcZUVOMaZaBWCrzahQ7lz0H7i2sm8jpz6OyI3Y+aGs93K3jtVa8REaI9UN6XVIom4dhWPpQj39RrpVym4cJxGRIGyT5TwMZ3PeIw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788963919; c=relaxed/simple; bh=VBiX16URm4W+OaE0G4+cX6+0xsIgVtNE0ec9U1R2leU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UNr+t1FKNd79HNuWUXMYR4Wp8CwT3NfOnMpCbFmyDMbHgw56FSjKMbCYlrxYWPS0kyMJx/2bxPp5iiNDAZ2uMXfyXk475zVgdsFWpTGoQDKIaiXbr0CKh/Z0ipIp3dcWNFXxvD2U5/iX6ziZBhMH+59OeGrTAW0L5WM0G2zGvkk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ah7Xt75J; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ah7Xt75J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A17521F00A3A; Wed, 9 Sep 2026 14:25:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788963918; bh=35or30h4tqakdfTJ1/b+elq7Q5mcHAscvf65qO6rcYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ah7Xt75JRMUV1K9kjnmRCH5Gqc7fN/1WprS66UYvKKhD+U4+peu+4lSLCpjGffZom V/HSZ+j7qwyQHeLF1C0N58JvWhRNUSxumSbeOYpUZ55Z0O2yCsqNlCYNUWzg2m/p28 cDGpdg/A4oRMXJRYzfoqLoA4nWvzlzDAkPobRuFw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christian Borntraeger , Matthew Rosato , Claudio Imbrenda Subject: [PATCH 6.18 244/583] KVM: s390: Fix memory leak in guest debug handling Date: Wed, 9 Sep 2026 15:38:49 +0200 Message-ID: <20260909134246.588295907@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260909134237.773280130@linuxfoundation.org> References: <20260909134237.773280130@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christian Borntraeger commit 121ea1de927c8b9bfdf53c31cad27b86d5de0293 upstream. bp_data is freed only for the error case by kfree(bp_data). Every successful KVM_SET_GUEST_DEBUG will leak bp_data. Fixes: 27291e2165b6 ("KVM: s390: hardware support for guest debugging") Cc: stable@vger.kernel.org Signed-off-by: Christian Borntraeger Reviewed-by: Matthew Rosato Reviewed-by: Claudio Imbrenda Signed-off-by: Claudio Imbrenda Message-ID: <20260805110455.7200-5-borntraeger@linux.ibm.com> Signed-off-by: Greg Kroah-Hartman --- arch/s390/kvm/guestdbg.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/s390/kvm/guestdbg.c +++ b/arch/s390/kvm/guestdbg.c @@ -271,6 +271,7 @@ int kvm_s390_import_bp_data(struct kvm_v vcpu->arch.guestdbg.hw_bp_info = bp_info; vcpu->arch.guestdbg.nr_hw_wp = nr_wp; vcpu->arch.guestdbg.hw_wp_info = wp_info; + kfree(bp_data); return 0; error: kfree(bp_data);