linux-stable/include
Kees Cook dd4904f3b9 interconnect: qcom: Annotate struct icc_onecell_data with __counted_by
Prepare 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 for struct icc_onecell_data.
Additionally, since the element count member must be set before accessing
the annotated flexible array member, move its initialization earlier.

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

Cc: Andy Gross <agross@kernel.org>
Cc: Bjorn Andersson <andersson@kernel.org>
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: Georgi Djakov <djakov@kernel.org>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230817204215.never.916-kees@kernel.org
Signed-off-by: Georgi Djakov <djakov@kernel.org>
2023-08-22 01:11:32 +03:00
..
acpi More ACPI updates for 6.5-rc1 2023-07-06 22:25:06 -07:00
asm-generic hyperv-fixes for 6.5-rc5 2023-08-04 17:16:14 -07:00
clocksource
crypto This update includes the following changes: 2023-06-30 21:27:13 -07:00
drm drm/fb-helper: Remove unused inline function drm_fb_helper_defio_init() 2023-07-25 20:38:37 +02:00
dt-bindings Merge branch 'icc-sm8250-qup' into icc-next 2023-07-18 11:18:53 +03:00
keys
kunit
kvm KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption 2023-07-13 22:23:34 +00:00
linux interconnect: qcom: Annotate struct icc_onecell_data with __counted_by 2023-08-22 01:11:32 +03:00
math-emu
media media updates for v6.5-rc1 2023-07-05 10:42:32 -07:00
memory
misc
net netfilter pull request 23-08-10 2023-08-10 10:47:08 -07:00
pcmcia
ras
rdma rdma: fix INFINIBAND_USER_ACCESS dependency 2023-07-03 16:55:04 -07:00
rv
scsi ata,scsi: do not issue START STOP UNIT on resume 2023-08-02 17:01:12 +09:00
soc Memory controller drivers - fixes for v6.5 2023-07-27 15:40:54 +02:00
sound ASoC: Updates for v6.5 2023-06-26 15:38:02 +02:00
target SCSI misc on 20230629 2023-06-30 11:57:07 -07:00
trace tcp: add missing family to tcp_set_ca_state() tracepoint 2023-08-09 13:45:19 -07:00
uapi Including fixes from bpf and wireless. 2023-08-03 14:00:02 -07:00
ufs Merge branch '6.5/scsi-staging' into 6.5/scsi-fixes 2023-07-11 12:15:15 -04:00
vdso
video sticon/parisc: Fix STI console on 64-bit only machines 2023-06-30 17:14:14 +02:00
xen xen/evtchn: Introduce new IOCTL to bind static evtchn 2023-07-26 08:42:34 +02:00