Skip to content

Commit afa9a6f

Browse files
committed
Merge tag 'staging-6.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver fix from Greg KH: "Here is a single staging driver fix for 6.16-rc4. It resolves a build error in the rtl8723bs driver for some versions of clang on arm64 when checking the frame size with -Wframe-larger-than. It has been in linux-next for a while now with no reported issues" * tag 'staging-6.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: rtl8723bs: Avoid memset() in aes_cipher() and aes_decipher()
2 parents 798804b + a55bc4f commit afa9a6f

File tree

1 file changed

+14
-30
lines changed

1 file changed

+14
-30
lines changed

drivers/staging/rtl8723bs/core/rtw_security.c

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -868,29 +868,21 @@ static signed int aes_cipher(u8 *key, uint hdrlen,
868868
num_blocks, payload_index;
869869

870870
u8 pn_vector[6];
871-
u8 mic_iv[16];
872-
u8 mic_header1[16];
873-
u8 mic_header2[16];
874-
u8 ctr_preload[16];
871+
u8 mic_iv[16] = {};
872+
u8 mic_header1[16] = {};
873+
u8 mic_header2[16] = {};
874+
u8 ctr_preload[16] = {};
875875

876876
/* Intermediate Buffers */
877-
u8 chain_buffer[16];
878-
u8 aes_out[16];
879-
u8 padded_buffer[16];
877+
u8 chain_buffer[16] = {};
878+
u8 aes_out[16] = {};
879+
u8 padded_buffer[16] = {};
880880
u8 mic[8];
881881
uint frtype = GetFrameType(pframe);
882882
uint frsubtype = GetFrameSubType(pframe);
883883

884884
frsubtype = frsubtype>>4;
885885

886-
memset((void *)mic_iv, 0, 16);
887-
memset((void *)mic_header1, 0, 16);
888-
memset((void *)mic_header2, 0, 16);
889-
memset((void *)ctr_preload, 0, 16);
890-
memset((void *)chain_buffer, 0, 16);
891-
memset((void *)aes_out, 0, 16);
892-
memset((void *)padded_buffer, 0, 16);
893-
894886
if ((hdrlen == WLAN_HDR_A3_LEN) || (hdrlen == WLAN_HDR_A3_QOS_LEN))
895887
a4_exists = 0;
896888
else
@@ -1080,30 +1072,22 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
10801072
num_blocks, payload_index;
10811073
signed int res = _SUCCESS;
10821074
u8 pn_vector[6];
1083-
u8 mic_iv[16];
1084-
u8 mic_header1[16];
1085-
u8 mic_header2[16];
1086-
u8 ctr_preload[16];
1075+
u8 mic_iv[16] = {};
1076+
u8 mic_header1[16] = {};
1077+
u8 mic_header2[16] = {};
1078+
u8 ctr_preload[16] = {};
10871079

10881080
/* Intermediate Buffers */
1089-
u8 chain_buffer[16];
1090-
u8 aes_out[16];
1091-
u8 padded_buffer[16];
1081+
u8 chain_buffer[16] = {};
1082+
u8 aes_out[16] = {};
1083+
u8 padded_buffer[16] = {};
10921084
u8 mic[8];
10931085

10941086
uint frtype = GetFrameType(pframe);
10951087
uint frsubtype = GetFrameSubType(pframe);
10961088

10971089
frsubtype = frsubtype>>4;
10981090

1099-
memset((void *)mic_iv, 0, 16);
1100-
memset((void *)mic_header1, 0, 16);
1101-
memset((void *)mic_header2, 0, 16);
1102-
memset((void *)ctr_preload, 0, 16);
1103-
memset((void *)chain_buffer, 0, 16);
1104-
memset((void *)aes_out, 0, 16);
1105-
memset((void *)padded_buffer, 0, 16);
1106-
11071091
/* start to decrypt the payload */
11081092

11091093
num_blocks = (plen-8) / 16; /* plen including LLC, payload_length and mic) */

0 commit comments

Comments
 (0)