Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wifi: mac80211: remove misleading j_0 construction parts

The GCM algorithm implementation in the kernel assumes that
a 12-byte IV is passed, not the actual J_0 from the GCM spec.
Don't rename, that'd be messy, but also don't fill the bytes
beyond the IV that aren't used, since otherwise it looks as
though j_0[12] is used uninitialized.

Link: https://patch.msgid.link/20241021151414.798ceb7a5896.Ic57751edad228d56865ecf7433fef469e5e0a4aa@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

-3
-3
net/mac80211/wpa.c
··· 598 598 599 599 memcpy(j_0, hdr->addr2, ETH_ALEN); 600 600 memcpy(&j_0[ETH_ALEN], pn, IEEE80211_GCMP_PN_LEN); 601 - j_0[13] = 0; 602 - j_0[14] = 0; 603 - j_0[AES_BLOCK_SIZE - 1] = 0x01; 604 601 605 602 ccmp_gcmp_aad(skb, aad, spp_amsdu); 606 603 }