linux/drivers/infiniband
Kees Cook 8f649b5785 IB/hfi1: Replace 1-element array with singleton
Zero-length arrays are deprecated[1] and are being replaced with flexible
array members in support of the ongoing efforts to tighten the
FORTIFY_SOURCE routines on memcpy(), correctly instrument array indexing
with UBSAN_BOUNDS, and to globally enable -fstrict-flex-arrays=3.

Replace zero-length array with flexible-array member "lvs" in struct
opa_port_data_counters_msg and struct opa_port_error_counters64_msg.

Additionally, the "port" member of several structs is defined as a
single-element, but is only ever accessed at index 0. Replace it with a
singleton so that flexible array usage is sane.

This results in no differences in binary output.

[1] https://github.com/KSPP/linux/issues/78

Link: https://lore.kernel.org/r/20221118215847.never.416-kees@kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2022-11-18 19:54:11 -04:00
..
core RDMA/nldev: Return "-EAGAIN" if the cm_id isn't from expected port 2022-11-15 09:56:45 +02:00
hw IB/hfi1: Replace 1-element array with singleton 2022-11-18 19:54:11 -04:00
sw RDMA/siw: Set defined status for work completion with undefined status 2022-11-15 16:47:00 -04:00
ulp RDMA/rtrs-srv: Remove kobject_del from rtrs_srv_destroy_once_sysfs_root_folders 2022-11-17 13:47:28 +02:00
Kconfig RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter 2022-11-11 11:40:09 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00