drm/nouveau/fb/ga102: Replace zero-length array of trailing structs with flex-array
Subsystems (3)
PATCH 1/1 drm/nouveau/fb/ga102: Replace zero-length array of trailing structs with flex-array
Zero-length arrays are deprecated[1] and are being replaced with flexible array members in support of the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy(), correctly instrument array indexing with UBSAN_BOUNDS, and to globally enable -fstrict-flex-arrays=3.
Replace zero-length array with flexible-array member.
This results in no differences in binary output.
[1] https://github.com/KSPP/linux/issues/78
--- drivers/gpu/drm/nouveau/include/nvfw/hs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/include/nvfw/hs.h +1 -1
@@ -52,7 +52,7 @@ struct nvfw_hs_load_header_v2 {struct {u32 offset;u32 size; - } app[0 ]; + } app[]; };const struct nvfw_hs_load_header_v2 *nvfw_hs_load_header_v2 (struct nvkm_subdev *,const void *);
Signature · 1 line
2.34.1
Quoted 11 lines · Kees Cook
Zero-length arrays are deprecated[1] and are being replaced with flexible array members in support of the ongoing efforts to tighten the
FORTIFY_SOURCEroutines onmemcpy(), correctly instrument array indexing withUBSAN_BOUNDS, and to globally enable -fstrict-flex-arrays=3.Replace zero-length array with flexible-array member.
This results in no differences in binary output.
Quoted 10 lines
Cc Ben Skeggs <[email protected]>Cc Karol Herbst <[email protected]>Cc Lyude Paul <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Gourav Samaiya <[email protected]>Cc "Gustavo A. R. Silva" <[email protected]>Signed-off-by Kees Cook <[email protected]>
Thanks!
--
Gustavo
Quoted 20 lines
--- drivers/gpu/drm/nouveau/include/nvfw/hs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/nouveau/include/nvfw/hs.h +1
-1@@ -52,7 +52,7 @@ struct nvfw_hs_load_header_v2 {struct {u32 offset;u32 size; - } app[0 ]; + } app[]; };const struct nvfw_hs_load_header_v2 *nvfw_hs_load_header_v2 (struct nvkm_subdev *,const void *);Signature · 1 line
2.34.1