linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath6kl: minor fix for allocation size
@ 2023-01-17 11:04 Alexey V. Vissarionov
  2023-01-17 15:24 ` Simon Horman
  2023-02-17 16:03 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey V. Vissarionov @ 2023-01-17 11:04 UTC (permalink / raw)
  To: Kalle Valo
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Vasanthakumar Thiagarajan, Raja Mani, Suraj Sumangala,
	Vivek Natarajan, Joe Perches, linux-wireless, netdev,
	lvc-project, Alexey V. Vissarionov

[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]

Although the "param" pointer occupies more or equal space compared
to "*param", the allocation size should use the size of variable
itself.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: bdcd81707973cf8a ("Add ath6kl cleaned up driver")
Signed-off-by: Alexey V. Vissarionov <gremlin@altlinux.org>

diff --git a/drivers/net/wireless/ath/ath6kl/bmi.c b/drivers/net/wireless/ath/ath6kl/bmi.c
index bde5a10d470c8e74..af98e871199d317f 100644
--- a/drivers/net/wireless/ath/ath6kl/bmi.c
+++ b/drivers/net/wireless/ath/ath6kl/bmi.c
@@ -246,7 +246,7 @@ int ath6kl_bmi_execute(struct ath6kl *ar, u32 addr, u32 *param)
 		return -EACCES;
 	}
 
-	size = sizeof(cid) + sizeof(addr) + sizeof(param);
+	size = sizeof(cid) + sizeof(addr) + sizeof(*param);
 	if (size > ar->bmi.max_cmd_size) {
 		WARN_ON(1);
 		return -EINVAL;



-- 
Alexey V. Vissarionov
gremlin ПРИ altlinux ТЧК org; +vii-cmiii-ccxxix-lxxix-xlii
GPG: 0D92F19E1C0DC36E27F61A29CD17E2B43D879005 @ hkp://keys.gnupg.net

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* Re: [PATCH] ath6kl: minor fix for allocation size
  2023-01-17 11:04 [PATCH] ath6kl: minor fix for allocation size Alexey V. Vissarionov
@ 2023-01-17 15:24 ` Simon Horman
  2023-02-17 16:03 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-01-17 15:24 UTC (permalink / raw)
  To: Alexey V. Vissarionov
  Cc: Kalle Valo, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Vasanthakumar Thiagarajan, Raja Mani,
	Suraj Sumangala, Vivek Natarajan, Joe Perches, linux-wireless,
	netdev, lvc-project

On Tue, Jan 17, 2023 at 02:04:14PM +0300, Alexey V. Vissarionov wrote:
> Although the "param" pointer occupies more or equal space compared
> to "*param", the allocation size should use the size of variable
> itself.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: bdcd81707973cf8a ("Add ath6kl cleaned up driver")
> Signed-off-by: Alexey V. Vissarionov <gremlin@altlinux.org>

Reviewed-by: Simon Horman <simon.horman@corigine.com>

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

* Re: [PATCH] ath6kl: minor fix for allocation size
  2023-01-17 11:04 [PATCH] ath6kl: minor fix for allocation size Alexey V. Vissarionov
  2023-01-17 15:24 ` Simon Horman
@ 2023-02-17 16:03 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2023-02-17 16:03 UTC (permalink / raw)
  To: Alexey V. Vissarionov
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Vasanthakumar Thiagarajan, Raja Mani, Suraj Sumangala,
	Vivek Natarajan, Joe Perches, linux-wireless, netdev,
	lvc-project, Alexey V. Vissarionov

"Alexey V. Vissarionov" <gremlin@altlinux.org> wrote:

> Although the "param" pointer occupies more or equal space compared
> to "*param", the allocation size should use the size of variable
> itself.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: bdcd81707973cf8a ("Add ath6kl cleaned up driver")
> Signed-off-by: Alexey V. Vissarionov <gremlin@altlinux.org>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

778f83f889e7 wifi: ath6kl: minor fix for allocation size

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230117110414.GC12547@altlinux.org/

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


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

end of thread, other threads:[~2023-02-17 16:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-17 11:04 [PATCH] ath6kl: minor fix for allocation size Alexey V. Vissarionov
2023-01-17 15:24 ` Simon Horman
2023-02-17 16:03 ` 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).