ksmbd: replace one-element arrays with flexible-array members
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 15 Nov 2022 15:35:10 +0000 (09:35 -0600)
committerSteve French <stfrench@microsoft.com>
Sun, 11 Dec 2022 14:33:31 +0000 (08:33 -0600)
commit30429388531b120902126a39cf64f877fc5c7773
tree165b3ef017c81f92957bfe3984f28accbb26409f
parent7ecbe92696bb7fe32c80b6cf64736a0d157717a9
ksmbd: replace one-element arrays with flexible-array members

One-element arrays are deprecated, and we are replacing them with flexible
array members instead. So, replace one-element arrays with flexible-array
members in multiple structs in fs/ksmbd/smb_common.h and one in
fs/ksmbd/smb2pdu.h.

Important to mention is that doing a build before/after this patch results
in no binary output differences.

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines
on memcpy() and help us make progress towards globally enabling
-fstrict-flex-arrays=3 [1].

Link: https://github.com/KSPP/linux/issues/242
Link: https://github.com/KSPP/linux/issues/79
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/smb2pdu.c
fs/ksmbd/smb2pdu.h
fs/ksmbd/smb_common.h