Skip to content

Commit

Permalink
rtw88: debug: Fix uninitialized memory in debugfs code
Browse files Browse the repository at this point in the history
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: e303748 ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/X8ilOfVz3pf0T5ec@mwanda
  • Loading branch information
Dan Carpenter authored and Kalle Valo committed Dec 3, 2020
1 parent 8079820 commit 74a8c81
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/realtek/rtw88/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 74a8c81

Please sign in to comment.