linux/drivers/infiniband/hw/mthca
Kees Cook 2aba54a9e0 IB/mthca: Annotate struct mthca_icm_table 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 mthca_icm_table.

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

Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: linux-rdma@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230929180431.3005464-6-keescook@chromium.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2023-10-02 14:44:54 +03:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile
mthca_allocator.c IB/mthca: Use non-atomic bitmap functions when possible in 'mthca_allocator.c' 2021-11-25 13:29:06 -04:00
mthca_av.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mthca_catas.c
mthca_cmd.c IB: move from strlcpy with unused retval to strscpy 2022-08-21 14:18:02 +03:00
mthca_cmd.h
mthca_config_reg.h
mthca_cq.c Linux 5.10-rc6 2020-12-01 20:40:50 -04:00
mthca_dev.h RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mthca_doorbell.h
mthca_eq.c RDMA: switch from 'pci_' to 'dma_' API 2021-08-23 13:43:54 -03:00
mthca_mad.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mthca_main.c IB/mthca: Remove useless DMA-32 fallback configuration 2022-01-28 10:49:03 -04:00
mthca_mcg.c
mthca_memfree.c RDMA: switch from 'pci_' to 'dma_' API 2021-08-23 13:43:54 -03:00
mthca_memfree.h IB/mthca: Annotate struct mthca_icm_table with __counted_by 2023-10-02 14:44:54 +03:00
mthca_mr.c IB/mthca: Use memset_startat() for clearing mpt_entry 2021-12-14 20:21:23 -04:00
mthca_pd.c
mthca_profile.c RDMA/mthca: Delete useless module.h include 2022-01-28 13:03:12 -04:00
mthca_profile.h
mthca_provider.c RDMA/mthca: Remove unnecessary NULL assignments 2023-07-31 10:59:06 +03:00
mthca_provider.h RDMA/mthca: Combine special QP struct with mthca QP 2020-09-29 13:11:07 -03:00
mthca_qp.c RDMA/mthca: Fix crash when polling CQ for shared QPs 2023-07-17 08:02:13 +03:00
mthca_reset.c
mthca_srq.c drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
mthca_uar.c
mthca_wqe.h