public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 1/2] crypto: fix uninitialized variable coverity warning
@ 2024-02-27 21:16 James Prestwood
  2024-02-27 21:16 ` [PATCH 2/2] station: warn on missing scan_bss in station_transition_start James Prestwood
  2024-02-27 22:03 ` [PATCH 1/2] crypto: fix uninitialized variable coverity warning Denis Kenzior
  0 siblings, 2 replies; 3+ messages in thread
From: James Prestwood @ 2024-02-27 21:16 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

Same as for aes_siv_decrypt, check num_ads before calling memcpy.
---
 src/crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/crypto.c b/src/crypto.c
index 7235e3c2..15a7cde7 100644
--- a/src/crypto.c
+++ b/src/crypto.c
@@ -390,7 +390,7 @@ bool aes_siv_decrypt(const void *key, size_t key_len, const void *in,
 	if (in_len < 16)
 		return false;
 
-	if (ad)
+	if (ad && num_ad)
 		memcpy(iov, ad, sizeof(struct iovec) * num_ad);
 
 	iov[num_ad].iov_base = (void *)out;
-- 
2.34.1


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

* [PATCH 2/2] station: warn on missing scan_bss in station_transition_start
  2024-02-27 21:16 [PATCH 1/2] crypto: fix uninitialized variable coverity warning James Prestwood
@ 2024-02-27 21:16 ` James Prestwood
  2024-02-27 22:03 ` [PATCH 1/2] crypto: fix uninitialized variable coverity warning Denis Kenzior
  1 sibling, 0 replies; 3+ messages in thread
From: James Prestwood @ 2024-02-27 21:16 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

This shouldn't be possible in theory since the roam_bss_list being
iterated is a subset of entire scan_bss list station/network has
but to be safe, and catch any issues due to future changes warn on
this condition.
---
 src/station.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/station.c b/src/station.c
index 477f444a..641068cc 100644
--- a/src/station.c
+++ b/src/station.c
@@ -2533,6 +2533,8 @@ static void station_transition_start(struct station *station)
 	while ((rbss = l_queue_peek_head(station->roam_bss_list))) {
 		struct scan_bss *bss = network_bss_find_by_addr(
 					station->connected_network, rbss->addr);
+		if (L_WARN_ON(!bss))
+			continue;
 
 		roaming = station_try_next_transition(station, bss,
 							rbss->ft_failed);
-- 
2.34.1


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

* Re: [PATCH 1/2] crypto: fix uninitialized variable coverity warning
  2024-02-27 21:16 [PATCH 1/2] crypto: fix uninitialized variable coverity warning James Prestwood
  2024-02-27 21:16 ` [PATCH 2/2] station: warn on missing scan_bss in station_transition_start James Prestwood
@ 2024-02-27 22:03 ` Denis Kenzior
  1 sibling, 0 replies; 3+ messages in thread
From: Denis Kenzior @ 2024-02-27 22:03 UTC (permalink / raw)
  To: James Prestwood, iwd

Hi James,

On 2/27/24 15:16, James Prestwood wrote:
> Same as for aes_siv_decrypt, check num_ads before calling memcpy.
> ---
>   src/crypto.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Both applied, thanks.

Regards,
-Denis


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

end of thread, other threads:[~2024-02-27 22:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-27 21:16 [PATCH 1/2] crypto: fix uninitialized variable coverity warning James Prestwood
2024-02-27 21:16 ` [PATCH 2/2] station: warn on missing scan_bss in station_transition_start James Prestwood
2024-02-27 22:03 ` [PATCH 1/2] crypto: fix uninitialized variable coverity warning Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox