All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] eapol: zero entire buffer when creating frame
@ 2022-03-28 22:35 Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2022-03-28 22:35 UTC (permalink / raw)
  To: iwd

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

Hi James,

On 3/28/22 17:32, James Prestwood wrote:
> Since l_malloc is used the frame contents are not zero'ed automatically
> which could result in random bytes being present in the frame which were
> expected to be zero. This poses a problem when calculating the MIC as the
> crypto operations are done on the entire frame with the expectation of
> the MIC being zero.
> ---
>   src/eapol.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied, thanks.

Regards,
-Denis

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

* [PATCH] eapol: zero entire buffer when creating frame
@ 2022-03-28 22:32 James Prestwood
  0 siblings, 0 replies; 2+ messages in thread
From: James Prestwood @ 2022-03-28 22:32 UTC (permalink / raw)
  To: iwd

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

Since l_malloc is used the frame contents are not zero'ed automatically
which could result in random bytes being present in the frame which were
expected to be zero. This poses a problem when calculating the MIC as the
crypto operations are done on the entire frame with the expectation of
the MIC being zero.
---
 src/eapol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/eapol.c b/src/eapol.c
index 9f397d1d..e2c99991 100644
--- a/src/eapol.c
+++ b/src/eapol.c
@@ -706,7 +706,7 @@ static struct eapol_key *eapol_create_common(
 	struct eapol_key *out_frame = l_malloc(to_alloc + extra_len +
 						extra_key_len);
 
-	memset(out_frame, 0, to_alloc + extra_len);
+	memset(out_frame, 0, to_alloc + extra_len + extra_key_len);
 
 	out_frame->header.protocol_version = protocol;
 	out_frame->header.packet_type = 0x3;
-- 
2.34.1

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

end of thread, other threads:[~2022-03-28 22:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 22:35 [PATCH] eapol: zero entire buffer when creating frame Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2022-03-28 22:32 James Prestwood

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.