linux-stable/drivers/net
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
..
appletalk
arcnet
bonding
caif
can
dsa net: dsa: introduce preferred_default_local_cpu_port and use on MT7530 2023-06-20 09:40:26 +01:00
ethernet be2net: Extend xmit workaround to BE3 chip 2023-06-20 12:18:01 -07:00
fddi
fjes
hamradio
hippi
hyperv
ieee802154 Merge tag 'ieee802154-for-net-2023-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/wpan/wpan 2023-06-20 09:32:33 +01:00
ipa net: ipa: Use correct value for IPA_STATUS_SIZE 2023-06-01 13:29:18 +02:00
ipvlan ipvlan: fix bound dev checking for IPv6 l3s mode 2023-06-12 09:34:01 +01:00
mctp
mdio
netdevsim
pcs
phy Revert "net: phy: dp83867: perform soft reset and retain established link" 2023-06-20 20:20:22 -07:00
plip
ppp
pse-pd
slip
team
thunderbolt
usb net: usb: qmi_wwan: add support for Compal RXM-G1 2023-06-08 19:39:31 -07:00
vmxnet3
vxlan
wan net: lapbether: only support ethernet devices 2023-06-15 08:55:22 +01:00
wireguard
wireless wifi: iwlwifi: pcie: Handle SO-F device for PCI id 0x7AF0 2023-06-20 12:19:30 -07:00
wwan net: wwan: iosm: Convert single instance struct member to flexible array 2023-06-22 11:27:47 +02:00
xen-netback
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c net: macsec: fix double free of percpu stats 2023-06-15 11:41:01 +01:00
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
tun.c
veth.c
virtio_net.c virtio_net: use control_buf for coalesce params 2023-06-06 21:11:17 -07:00
vrf.c
vsockmon.c
xen-netfront.c