linux-stable/drivers/net/wwan
Kees Cook dec24b3b33 net: wwan: iosm: Convert single instance struct member to flexible array
struct mux_adth actually ends with multiple struct mux_adth_dg members.
This is seen both in the comments about the member:

/**
 * struct mux_adth - Structure of the Aggregated Datagram Table Header.
 ...
 * @dg:		datagramm table with variable length
 */

and in the preparation for populating it:

                        adth_dg_size = offsetof(struct mux_adth, dg) +
                                        ul_adb->dg_count[i] * sizeof(*dg);
			...
                        adth_dg_size -= offsetof(struct mux_adth, dg);
                        memcpy(&adth->dg, ul_adb->dg[i], adth_dg_size);

This was reported as a run-time false positive warning:

memcpy: detected field-spanning write (size 16) of single field "&adth->dg" at drivers/net/wwan/iosm/iosm_ipc_mux_codec.c:852 (size 8)

Adjust the struct mux_adth definition and associated sizeof() math; no binary
output differences are observed in the resulting object file.

Reported-by: Florian Klink <flokli@flokli.de>
Closes: https://lore.kernel.org/lkml/dbfa25f5-64c8-5574-4f5d-0151ba95d232@gmail.com/
Fixes: 1f52d7b622 ("net: wwan: iosm: Enable M.2 7360 WWAN card support")
Cc: M Chetan Kumar <m.chetan.kumar@intel.com>
Cc: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Intel Corporation <linuxwwan@intel.com>
Cc: Loic Poulain <loic.poulain@linaro.org>
Cc: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230620194234.never.023-kees@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-06-22 11:27:47 +02:00
..
iosm net: wwan: iosm: Convert single instance struct member to flexible array 2023-06-22 11:27:47 +02:00
t7xx net: wwan: t7xx: Ensure init is completed before system sleep 2023-05-17 13:02:25 +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 Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00
wwan_hwsim.c Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00