kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] rtw88: debug: Fix uninitialized memory in debugfs code
@ 2020-12-03  8:43 Dan Carpenter
  2020-12-03  9:16 ` Kalle Valo
  2020-12-03 16:01 ` Kalle Valo
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-12-03  8:43 UTC (permalink / raw)
  To: Yan-Hsuan Chuang
  Cc: Kalle Valo, Stanislaw Gruszka, Brian Norris, linux-wireless,
	kernel-janitors

This code does not ensure that the whole buffer is initialized and none
of the callers check for errors so potentially none of the buffer is
initialized.  Add a memset to eliminate this bug.

Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/wireless/realtek/rtw88/debug.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c
index 5974a8ef8b34..12efc23bbfcb 100644
--- a/drivers/net/wireless/realtek/rtw88/debug.c
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
@@ -147,6 +147,8 @@ static int rtw_debugfs_copy_from_user(char tmp[], int size,
 {
 	int tmp_len;
 
+	memset(tmp, 0, size);
+
 	if (count < num)
 		return -EFAULT;
 
-- 
2.29.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] rtw88: debug: Fix uninitialized memory in debugfs code
  2020-12-03  8:43 [PATCH net] rtw88: debug: Fix uninitialized memory in debugfs code Dan Carpenter
@ 2020-12-03  9:16 ` Kalle Valo
  2020-12-03 11:33   ` Dan Carpenter
  2020-12-03 16:01 ` Kalle Valo
  1 sibling, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2020-12-03  9:16 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Yan-Hsuan Chuang, Stanislaw Gruszka, Brian Norris,
	linux-wireless, kernel-janitors

Dan Carpenter <dan.carpenter@oracle.com> writes:

> This code does not ensure that the whole buffer is initialized and none
> of the callers check for errors so potentially none of the buffer is
> initialized.  Add a memset to eliminate this bug.
>
> Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/net/wireless/realtek/rtw88/debug.c | 2 ++
>  1 file changed, 2 insertions(+)

I'll take this to wireless-drivers, this shouldn't go to net.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] rtw88: debug: Fix uninitialized memory in debugfs code
  2020-12-03  9:16 ` Kalle Valo
@ 2020-12-03 11:33   ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-12-03 11:33 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Yan-Hsuan Chuang, Stanislaw Gruszka, Brian Norris,
	linux-wireless, kernel-janitors

On Thu, Dec 03, 2020 at 11:16:29AM +0200, Kalle Valo wrote:
> Dan Carpenter <dan.carpenter@oracle.com> writes:
> 
> > This code does not ensure that the whole buffer is initialized and none
> > of the callers check for errors so potentially none of the buffer is
> > initialized.  Add a memset to eliminate this bug.
> >
> > Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> >  drivers/net/wireless/realtek/rtw88/debug.c | 2 ++
> >  1 file changed, 2 insertions(+)
> 
> I'll take this to wireless-drivers, this shouldn't go to net.

Ugh...  The worst part about that is that I manually added the "net"
part without thinking thouroughly.  :/  Anyway, I've modified my QC
scripts now.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] rtw88: debug: Fix uninitialized memory in debugfs code
  2020-12-03  8:43 [PATCH net] rtw88: debug: Fix uninitialized memory in debugfs code Dan Carpenter
  2020-12-03  9:16 ` Kalle Valo
@ 2020-12-03 16:01 ` Kalle Valo
  1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2020-12-03 16:01 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Yan-Hsuan Chuang, Stanislaw Gruszka, Brian Norris,
	linux-wireless, kernel-janitors

Dan Carpenter <dan.carpenter@oracle.com> wrote:

> This code does not ensure that the whole buffer is initialized and none
> of the callers check for errors so potentially none of the buffer is
> initialized.  Add a memset to eliminate this bug.
> 
> Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Patch applied to wireless-drivers.git, thanks.

74a8c816fa8f rtw88: debug: Fix uninitialized memory in debugfs code

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/X8ilOfVz3pf0T5ec@mwanda/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-03 16:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03  8:43 [PATCH net] rtw88: debug: Fix uninitialized memory in debugfs code Dan Carpenter
2020-12-03  9:16 ` Kalle Valo
2020-12-03 11:33   ` Dan Carpenter
2020-12-03 16:01 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).