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 net: fix stack overflow when LRO is disabled for virtual interfaces 2023-05-19 22:46:37 -07:00
caif
can can: kvaser_pciefd: Disable interrupts in probe error path 2023-05-17 09:02:40 +02:00
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 hamradio: drop ISA_DMA_API dependency 2023-04-19 13:11:41 +01:00
hippi
hyperv hv_netvsc: Remove second mapping of send and recv buffers 2023-04-17 19:19:04 +00:00
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 net: mdio: i2c: fix rollball accessors 2023-05-15 10:15:57 +01:00
netdevsim
pcs net: pcs: xpcs: fix C73 AN not getting enabled 2023-05-17 12:59:53 +01:00
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 net: fix stack overflow when LRO is disabled for virtual interfaces 2023-05-19 22:46:37 -07:00
thunderbolt
usb net: usb: qmi_wwan: add support for Compal RXM-G1 2023-06-08 19:39:31 -07:00
vmxnet3 net: vmxnet3: Fix NULL pointer dereference in vmxnet3_rq_rx_complete() 2023-04-19 09:03:05 +01:00
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 net: veth: add page_pool stats 2023-04-24 18:07:08 -07:00
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 net: add vlan_get_protocol_and_depth() helper 2023-05-10 10:25:55 +01:00
tun.c tun: Fix memory leak for detached NAPI queue. 2023-05-17 09:02:55 +01:00
veth.c net: veth: add page_pool stats 2023-04-24 18:07:08 -07:00
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