linux-stable/drivers/net/wwan
Gustavo A. R. Silva 2dd3071892 net: wwan: t7xx: Add __counted_by for struct t7xx_fsm_event and use struct_size()
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 via CONFIG_UBSAN_BOUNDS (for
array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

While there, use struct_size() helper, instead of the open-coded
version, to calculate the size for the allocation of the whole
flexible structure, including of course, the flexible-array member.

This code was found with the help of Coccinelle, and audited and
fixed manually.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-10-13 10:11:48 +01:00
..
iosm Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-22 18:40:38 -07:00
t7xx net: wwan: t7xx: Add __counted_by for struct t7xx_fsm_event and use struct_size() 2023-10-13 10:11:48 +01:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-10 17:43:53 -08:00
Makefile net: wwan: t7xx: Add core components 2022-05-09 10:51:59 +01:00
mhi_wwan_ctrl.c wwan: core: Support slicing in port TX flow of WWAN subsystem 2023-03-17 22:38:31 -07:00
mhi_wwan_mbim.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-10 17:43:53 -08:00
qcom_bam_dmux.c net: wwan: qcom_bam_dmux: fix wrong pointer passed to IS_ERR() 2022-03-22 09:36:46 +01:00
rpmsg_wwan_ctrl.c net: wwan: Expose secondary AT port on DATA1 2023-04-19 12:54:26 +01:00
wwan_core.c wwan: core: Use the bitmap API to allocate bitmaps 2023-09-12 11:49:22 +02:00
wwan_hwsim.c Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00