linux/include/uapi/drm
Gustavo A. R. Silva 02abecdeeb drm/i915/uapi: Replace fake flex-array with flexible-array member
Zero-length arrays as fake flexible arrays are deprecated and we are
moving towards adopting C99 flexible-array members instead.

Address the following warning found with GCC-13 and
-fstrict-flex-arrays=3 enabled:
drivers/gpu/drm/i915/gem/i915_gem_context.c: In function ‘set_proto_ctx_engines.isra’:
drivers/gpu/drm/i915/gem/i915_gem_context.c:769:41: warning: array subscript n is outside array bounds of ‘struct i915_engine_class_instance[0]’ [-Warray-bounds=]
  769 |                 if (copy_from_user(&ci, &user->engines[n], sizeof(ci))) {
      |                                         ^~~~~~~~~~~~~~~~~
./include/uapi/drm/i915_drm.h:2494:43: note: while referencing ‘engines’
 2494 |         struct i915_engine_class_instance engines[0];

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/21
Link: https://github.com/KSPP/linux/issues/271
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1]
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZBSu2QsUJy31kjSE@work
2023-03-21 08:41:18 +00:00
..
amdgpu_drm.h drm/amdgpu: expose the minimum shader/memory clock frequency 2022-12-15 12:19:01 -05:00
armada_drm.h
drm.h
drm_fourcc.h drm/fourcc: Document open source user waiver 2023-01-05 13:10:38 +01:00
drm_mode.h
drm_sarea.h
etnaviv_drm.h
exynos_drm.h
i810_drm.h
i915_drm.h drm/i915/uapi: Replace fake flex-array with flexible-array member 2023-03-21 08:41:18 +00:00
lima_drm.h
mga_drm.h
msm_drm.h drm/msm: Add MSM_INFO_GET_FLAGS 2022-11-02 19:08:13 +03:00
nouveau_drm.h
omap_drm.h
panfrost_drm.h drm/panfrost: Remove type name from internal struct again 2022-11-07 15:35:43 +00:00
qxl_drm.h
r128_drm.h
radeon_drm.h
savage_drm.h
sis_drm.h
tegra_drm.h
v3d_drm.h
vc4_drm.h
vgem_drm.h
via_drm.h
virtgpu_drm.h
vmwgfx_drm.h