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 4E8D643F08C; Thu, 30 Jul 2026 14:21:37 +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=1785421299; cv=none; b=JyaIm89Q72/MQP+XMYt/xEdt2tSd+tMiohkZYpy5EiEn760qGMSy5F2PL3o4E3zuuj1DXUIYCxnhzqwORHMZatMNHESvHqfhFxM+Ub+gE/nVKATIMDhNQH5wD0FfePeOPmtK/NSTKWCsjrunX91knS2YY/YhUF0KBY/DhEfRu5g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785421299; c=relaxed/simple; bh=xm8Dh9OD/ha2W5IjiMJ+om3Pbt84Dva8DjvKB91DbN0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uIdh6TLwHTKoRXoxGbnzFJqMSaDlIb/XgPxC7MZjeHHdSS/wHxzPp7f7Hnc+p1Kib5BcwDRTlKirh2r7thYM/gqoR0AFNdqhmkbzGT/zj3tuxh91ZJMQECBHD9kk3Bcbbh2RMiLfiXbPUV2Y8C/nvaeZfFmo5FPR3arvkN6wQsc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zcIPQnvE; 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="zcIPQnvE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9E051F00A3D; Thu, 30 Jul 2026 14:21:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785421296; bh=djnuTAn3Yz+k80yfDRXrLUtAKTnQ9n+JbPI/AkwSFu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=zcIPQnvELOKo5JPW3Yqpd5r68/d0+Sf1OXJhIKF5dxZOC5v4JRhmB4U5ABw8tgSMQ 7AffTwNukV+HufOzDtCj4CZlZIMtOcQm2KHCpWQHhynisjAKxdpaO6toVbenyMZVnZ GmVsm/jAtGDA1ftQ/Ro98iQDaKKAuk8uw3VZNC+w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dawei Feng , Johannes Berg , Sasha Levin Subject: [PATCH 7.1 056/744] wifi: libertas: fix memory leak in helper_firmware_cb() Date: Thu, 30 Jul 2026 16:05:29 +0200 Message-ID: <20260730141445.467306798@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141444.267951807@linuxfoundation.org> References: <20260730141444.267951807@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 7.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dawei Feng [ Upstream commit 63c2391deefb31e1b801b7f32bd502ca4808639b ] helper_firmware_cb() neglects to free the single-stage firmware image after a successful async load, leading to a memory leak in the USB firmware-download path. Fix this memory leak by calling release_firmware() immediately after lbs_fw_loaded() returns. The bug was first flagged by an experimental analysis tool we are developing for kernel memory-management bugs while analyzing v6.13-rc1. The tool is still under development and is not yet publicly available. Manual inspection confirms that the bug is still present in the current wireless tree. An x86_64 allyesconfig build showed no new warnings. As we do not have compatible Libertas USB hardware for exercising this firmware-download path, no runtime testing was able to be performed. Fixes: 1dfba3060fe7 ("libertas: move firmware lifetime handling to firmware.c") Signed-off-by: Dawei Feng Link: https://patch.msgid.link/20260624085343.575508-1-dawei.feng@seu.edu.cn Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/marvell/libertas/firmware.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/marvell/libertas/firmware.c b/drivers/net/wireless/marvell/libertas/firmware.c index f124110944b7e9..9bf7d4c207b9ed 100644 --- a/drivers/net/wireless/marvell/libertas/firmware.c +++ b/drivers/net/wireless/marvell/libertas/firmware.c @@ -78,6 +78,7 @@ static void helper_firmware_cb(const struct firmware *firmware, void *context) } else { /* No main firmware needed for this helper --> success! */ lbs_fw_loaded(priv, 0, firmware, NULL); + release_firmware(firmware); } } -- 2.53.0