Re: [PATCH 0/9] drm: Annotate structs with __counted_by

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Am 29.09.23 um 21:33 schrieb Kees Cook:
On Fri, 22 Sep 2023 10:32:05 -0700, Kees Cook wrote:
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 this got Acks, I figure I should carry it in my tree. Let me know
if this should go via drm instead.

Applied to for-next/hardening, thanks!

[1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by

STOP! In a follow up discussion Alex and I figured out that this won't work.

The value in the structure is byte swapped based on some firmware endianness which not necessary matches the CPU endianness.

Please revert that one from going upstream if it's already on it's way.

And because of those reasons I strongly think that patches like this should go through the DRM tree :)


[2/9] drm/amdgpu/discovery: Annotate struct ip_hw_instance with __counted_by
[3/9] drm/i915/selftests: Annotate struct perf_series with __counted_by
[4/9] drm/msm/dpu: Annotate struct dpu_hw_intr with __counted_by
[5/9] drm/nouveau/pm: Annotate struct nvkm_perfdom with __counted_by
[6/9] drm/vc4: Annotate struct vc4_perfmon with __counted_by
[7/9] drm/virtio: Annotate struct virtio_gpu_object_array with __counted_by
[8/9] drm/vmwgfx: Annotate struct vmw_surface_dirty with __counted_by
[9/9] drm/v3d: Annotate struct v3d_perfmon with __counted_by

Take care,

Virtualization mailing list

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux