virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] drm: Annotate structs with __counted_by
@ 2023-09-22 17:32 Kees Cook
  2023-09-22 17:32 ` [PATCH 1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table " Kees Cook
                   ` (9 more replies)
  0 siblings, 10 replies; 37+ messages in thread
From: Kees Cook @ 2023-09-22 17:32 UTC (permalink / raw)
  To: David Airlie
  Cc: Tejas Upadhyay, Emma Anholt, Tom Rix, Joonas Lahtinen, llvm,
	dri-devel, Chris Wilson, Prike Liang, Huang Rui, Andrzej Hajda,
	Marijn Suijten, Matthew Brost, Karol Herbst, Neil Armstrong,
	amd-gfx, Kuogee Hsieh, Nathan Chancellor,
	VMware Graphics Reviewers, Ben Skeggs, Andi Shyti, nouveau,
	David Airlie, virtualization, Chia-I Wu, linux-hardening,
	Lijo Lazar, Lyude Paul, Kees Cook, Yifan Zhang, linux-arm-msm,
	intel-gfx, Kevin Wang, Abhinav Kumar, Jani Nikula, Melissa Wen,
	Alex Deucher, Gurchetan Singh, Maxime Ripard, Rodrigo Vivi,
	Evan Quan, Sean Paul, Tvrtko Ursulin, Xiaojian Du, Le Ma,
	freedreno, Bjorn Andersson, Pan, Xinhui, Nick Desaulniers,
	linux-kernel, Rob Clark, Zack Rusin, Daniel Vetter,
	Dmitry Baryshkov, Nirmoy Das, Lang Yu, Christian König,
	John Harrison, Hawking Zhang

Hi,

This is a batch of patches touching drm for preparing for the coming
implementation by GCC and Clang of the __counted_by attribute. Flexible
array members annotated with __counted_by can have their accesses
bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array
indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions).

As found with Coccinelle[1], add __counted_by to structs that would
benefit from the annotation.

Since the element count member must be set before accessing the annotated
flexible array member, some patches also move the member's initialization
earlier. (These are noted in the individual patches.)

-Kees

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Kees Cook (9):
  drm/amd/pm: Annotate struct smu10_voltage_dependency_table with
    __counted_by
  drm/amdgpu/discovery: Annotate struct ip_hw_instance with __counted_by
  drm/i915/selftests: Annotate struct perf_series with __counted_by
  drm/msm/dpu: Annotate struct dpu_hw_intr with __counted_by
  drm/nouveau/pm: Annotate struct nvkm_perfdom with __counted_by
  drm/vc4: Annotate struct vc4_perfmon with __counted_by
  drm/virtio: Annotate struct virtio_gpu_object_array with __counted_by
  drm/vmwgfx: Annotate struct vmw_surface_dirty with __counted_by
  drm/v3d: Annotate struct v3d_perfmon with __counted_by

 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c        | 2 +-
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.h | 2 +-
 drivers/gpu/drm/i915/selftests/i915_request.c        | 2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.h    | 2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/pm/priv.h        | 2 +-
 drivers/gpu/drm/v3d/v3d_drv.h                        | 2 +-
 drivers/gpu/drm/vc4/vc4_drv.h                        | 2 +-
 drivers/gpu/drm/virtio/virtgpu_drv.h                 | 2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c              | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

-- 
2.34.1

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2023-10-05 16:16 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-22 17:32 [PATCH 0/9] drm: Annotate structs with __counted_by Kees Cook
2023-09-22 17:32 ` [PATCH 1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table " Kees Cook
2023-09-22 17:41   ` Alex Deucher
2023-09-25  6:30     ` Christian König via Virtualization
2023-09-25 14:07       ` Alex Deucher
2023-09-25 14:14         ` Alex Deucher
2023-09-25 17:52       ` Kees Cook
2023-09-25 17:56         ` Alex Deucher
2023-09-23  2:13   ` Gustavo A. R. Silva
2023-09-22 17:32 ` [PATCH 2/9] drm/amdgpu/discovery: Annotate struct ip_hw_instance " Kees Cook
2023-09-22 17:42   ` Alex Deucher
2023-09-23  2:14   ` Gustavo A. R. Silva
2023-09-22 17:32 ` [PATCH 3/9] drm/i915/selftests: Annotate struct perf_series " Kees Cook
2023-09-23  2:14   ` Gustavo A. R. Silva
     [not found]   ` <b668d521-c8fd-1207-0a65-e1200e7ebb2c@intel.com>
2023-09-25 17:50     ` Kees Cook
2023-09-22 17:32 ` [PATCH 4/9] drm/msm/dpu: Annotate struct dpu_hw_intr " Kees Cook
2023-09-23  2:15   ` Gustavo A. R. Silva
2023-09-22 17:32 ` [PATCH 5/9] drm/nouveau/pm: Annotate struct nvkm_perfdom " Kees Cook
2023-09-22 19:00   ` Lyude Paul
2023-09-23  2:15   ` Gustavo A. R. Silva
2023-09-22 17:32 ` [PATCH 6/9] drm/vc4: Annotate struct vc4_perfmon " Kees Cook
2023-09-23  2:16   ` Gustavo A. R. Silva
2023-09-22 17:32 ` [PATCH 7/9] drm/virtio: Annotate struct virtio_gpu_object_array " Kees Cook
2023-09-23  2:36   ` Gustavo A. R. Silva
2023-09-22 17:32 ` [PATCH 8/9] drm/vmwgfx: Annotate struct vmw_surface_dirty " Kees Cook
2023-09-23  2:37   ` Gustavo A. R. Silva
2023-09-22 17:32 ` [PATCH 9/9] drm/v3d: Annotate struct v3d_perfmon " Kees Cook
2023-09-29 19:33 ` [PATCH 0/9] drm: Annotate structs " Kees Cook
2023-10-02  9:20   ` Christian König
2023-10-02 15:06     ` Alex Deucher
2023-10-02 16:53       ` Kees Cook
2023-10-02 18:01         ` Christian König
2023-10-02 18:08           ` Kees Cook
2023-10-02 18:11             ` Christian König via Virtualization
2023-10-02 18:22               ` Kees Cook
2023-10-05  9:42                 ` Christian König
2023-10-05 16:16                   ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).