KSPP / linux

Linux kernel source tree (Kernel Self Protection Project)
https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
Other
80 stars 5 forks source link

Replace fake flexible array with C99 flexible-array member in include/uapi/drm/i915_drm.h #271

Closed GustavoARSilva closed 1 year ago

GustavoARSilva commented 1 year ago
CC      drivers/gpu/drm/i915/gem/i915_gem_context.o
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))) {
      |                                         ^~~~~~~~~~~~~~~~~
In file included from ./drivers/gpu/drm/i915/i915_pmu.h:13,
                 from ./drivers/gpu/drm/i915/gt/intel_engine_types.h:21,
                 from ./drivers/gpu/drm/i915/gt/intel_reset.h:13,
                 from ./drivers/gpu/drm/i915/gt/intel_gtt.h:28,
                 from ./drivers/gpu/drm/i915/gt/gen6_ppgtt.h:9,
                 from drivers/gpu/drm/i915/gem/i915_gem_context.c:74:
./include/uapi/drm/i915_drm.h:2494:43: note: while referencing ‘engines’
 2494 |         struct i915_engine_class_instance engines[0];
GustavoARSilva commented 1 year ago

Patch: https://lore.kernel.org/linux-hardening/ZBSu2QsUJy31kjSE@work/