From: Greg KH <gregkh@linuxfoundation.org>
To: Ivy Lopez <skunkolee@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: use kfree_sensitive() for key material
Date: Wed, 15 Jul 2026 16:09:08 +0200 [thread overview]
Message-ID: <2026071557-overhand-cattishly-72fb@gregkh> (raw)
In-Reply-To: <20260713233753.50816-1-skunkolee@gmail.com>
On Mon, Jul 13, 2026 at 05:37:53PM -0600, Ivy Lopez wrote:
> 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.
>
> Signed-off-by: Ivy Lopez <skunkolee@gmail.com>
> ---
> 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 b932670f5d63..a34ee407285b 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.55.0
>
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- This looks like a new version of a previously submitted patch, but you
did not list below the --- line any changes from the previous version.
Please read the section entitled "The canonical patch format" in the
kernel file, Documentation/process/submitting-patches.rst for what
needs to be done here to properly describe this.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
next prev parent reply other threads:[~2026-07-15 14:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 23:34 [PATCH] staging: rtl8723bs: use kfree_sensitive() for key material Ivy Lopez
2026-07-13 23:37 ` Ivy Lopez
2026-07-15 14:09 ` Greg KH [this message]
2026-07-14 7:20 ` Dan Carpenter
2026-07-14 21:20 ` Ivy Lopez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026071557-overhand-cattishly-72fb@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=skunkolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.