linux-stable/drivers/net
Alexander Lobakin 5e7f59fa07 virtchnl: fix fake 1-elem arrays in structures allocated as `nents + 1`
There are five virtchnl structures, which are allocated and checked in
the code as `nents + 1`, meaning that they always have memory for one
excessive element regardless of their actual number. This comes from
that their sizeof() includes space for 1 element and then they get
allocated via struct_size() or its open-coded equivalents, passing
the actual number of elements.
Expand virtchnl_struct_size() to handle such structures and replace
those 1-elem arrays with proper flex ones. Also fix several places
which open-code %IAVF_VIRTCHNL_VF_RESOURCE_SIZE. Finally, let the
virtchnl_ether_addr_list size be computed automatically when there's
no enough space for the whole list, otherwise we have to open-code
reverse struct_size() logics.

Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2023-08-16 09:05:04 -07:00
..
appletalk
arcnet
bonding bonding: remove unnecessary NULL check in bond_destructor 2023-08-11 11:10:55 +01:00
caif
can can: esd_usb: Add support for esd CAN-USB/3 2023-08-03 09:24:30 +02:00
dsa net: dsa: rzn1-a5psw: Remove redundant of_match_ptr() 2023-08-16 09:59:40 +01:00
ethernet virtchnl: fix fake 1-elem arrays in structures allocated as `nents + 1` 2023-08-16 09:05:04 -07:00
fddi
fjes
hamradio
hippi
hyperv eth: add missing xdp.h includes in drivers 2023-08-03 08:38:07 -07:00
ieee802154
ipa
ipvlan
mctp
mdio
netdevsim net: netdevsim: mimic tc-taprio offload 2023-08-09 15:59:21 -07:00
pcs net: pcs: lynx: fix lynx_pcs_link_up_sgmii() not doing anything in fixed-link mode 2023-08-13 12:32:44 +01:00
phy net: phy: mediatek-ge-soc: support PHY LEDs 2023-08-15 18:57:59 -07:00
plip
ppp
pse-pd
slip
team team: remove unused input parameters in lb_htpm_select_tx_port and lb_hash_select_tx_port 2023-08-08 15:04:05 -07:00
thunderbolt
usb eth: r8152: try to use a normal budget 2023-08-15 19:07:12 -07:00
vmxnet3 vmxnet3: Add XDP support. 2023-08-14 08:03:52 +01:00
vxlan vxlan: Use helper functions to update stats 2023-08-14 08:06:24 +01:00
wan
wireguard genetlink: use attrs from struct genl_info 2023-08-15 15:00:45 -07:00
wireless wlcore: spi: Remove redundant of_match_ptr() 2023-08-16 09:59:40 +01:00
wwan
xen-netback xen/netback: Fix buffer overrun triggered by unusual packet 2023-08-03 09:04:08 +02:00
Kconfig vmxnet3: Add XDP support. 2023-08-14 08:03:52 +01:00
LICENSE.SRC
Makefile
Space.c
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
loopback.c
macsec.c net: macsec: Use helper functions to update stats 2023-08-14 08:06:24 +01:00
macvlan.c net: macvlan: convert to ndo_hwtstamp_get() / ndo_hwtstamp_set() 2023-08-02 19:11:06 -07:00
macvtap.c
mdio.c
mhi_net.c net: mhi: Remove redundant initialization owner in mhi_net_driver 2023-08-10 17:29:42 -07:00
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c pull-request: bpf-next 2023-08-03 2023-08-03 15:34:36 -07:00
tun.c tun: avoid high-order page allocation for packet header 2023-08-10 19:33:35 -07:00
veth.c page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00
virtio_net.c pull-request: bpf-next 2023-08-03 2023-08-03 15:34:36 -07:00
vrf.c
vsockmon.c
xen-netfront.c page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00