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 BE1B43612F6; Sat, 12 Sep 2026 07:59:53 +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=1789199995; cv=none; b=QceaKfCCbscc5AP6i7Y8Z6ZA2rv079fXa4VCf86r7e9xuslatFEl7NyrrV7Z+Z4sc6X/JbQOys9EZ9yk+63T4hbMbr5wGQ5eyUFZGCqo91+gf/JRU4b4qQ5tzrVAp4KX6bYAW7IQewJdBaTKKgkwVEKzhOMXX+jtC7yZAtV4rPM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789199995; c=relaxed/simple; bh=pDFFEVG5o+Tb1zHjcoQswJvGuUjujFbCxILqOP/Q6+0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YyYy6mm5qtH6mLJ4T6ukRzCcPJxpnEii0GCqftWiqbLueA4fmAzVnNLQ/GcS/lhrRgbxuwuVjWcgvXQ3CFYjzmOPLo8KuSFsM0FwU2WzR7ga+zxQ6YON+SoJy7mVJ1r2YzHRz98hyHI6BamCrT1I+rXxqI4tLH6M/UVkZCb5fgI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ij35Nc0d; 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="Ij35Nc0d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 177701F000FF; Sat, 12 Sep 2026 07:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789199993; bh=qPJ7CT693WLOxd/tdOa2du0MHE3uB1vu217IEGLvdD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ij35Nc0dk7iUPY/bt+YCmOdQVDphqlexMIiDsQJAuzIQ6G0ovSueForiuYSgujDt4 R7Zt4o9/UhU37umoIaOOzK8GJvBMhfFR63uyayIacyBU8VwlQvRYEpSxiC2UE9IM5r oWPigxDbsLZvNnSB1MN0VlGWvjWoynDc4cgSu3N4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ivy Lopez , Sasha Levin Subject: [PATCH 7.2 0700/1815] staging: rtl8723bs: use kfree_sensitive() for key material Date: Sat, 12 Sep 2026 08:40:50 +0200 Message-ID: <20260912065705.325020739@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065648.999753832@linuxfoundation.org> References: <20260912065648.999753832@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.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ivy Lopez [ Upstream commit d205dfa8cb825f1954ca1cfa474fc50bf06ee4aa ] The set_stakey_parm struct contains a 16-byte encryption key. Use kfree_sensitive() instead of kfree() to ensure the key material is zeroed before the memory is freed, preventing potential information leaks. Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Signed-off-by: Ivy Lopez Link: https://patch.msgid.link/20260717220135.17836-1-skunkolee@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/rtl8723bs/core/rtw_cmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index b932670f5d63a..a34ee407285be 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -899,7 +899,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_ if (enqueue) { ph2c = kzalloc_obj(*ph2c); if (!ph2c) { - kfree(psetstakey_para); + kfree_sensitive(psetstakey_para); res = _FAIL; goto exit; } @@ -907,7 +907,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_ psetstakey_rsp = kzalloc_obj(*psetstakey_rsp); if (!psetstakey_rsp) { kfree(ph2c); - kfree(psetstakey_para); + kfree_sensitive(psetstakey_para); res = _FAIL; goto exit; } @@ -918,7 +918,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_ res = rtw_enqueue_cmd(pcmdpriv, ph2c); } else { set_stakey_hdl(padapter, (u8 *)psetstakey_para); - kfree(psetstakey_para); + kfree_sensitive(psetstakey_para); } exit: return res; @@ -958,7 +958,7 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 enqueu psetstakey_rsp = kzalloc_obj(*psetstakey_rsp); if (!psetstakey_rsp) { kfree(ph2c); - kfree(psetstakey_para); + kfree_sensitive(psetstakey_para); res = _FAIL; goto exit; } -- 2.53.0