linux-stable/drivers/net/ethernet
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
..
3com
8390 net: ethernet: 8390: ne2k-pci: use module_pci_driver() macro 2023-08-10 19:31:57 -07:00
actions
adaptec
adi net: ethernet: adi: adin1110: use eth_broadcast_addr() to assign broadcast address 2023-08-06 13:22:47 +01:00
aeroflex net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
agere et131x: Use pci_dev_id() to simplify the code 2023-08-13 12:30:39 +01:00
alacritech net: ethernet: slicoss: remove redundant increment of pointer data 2023-07-28 15:37:08 -07:00
allwinner
alteon
altera
amazon eth: add missing xdp.h includes in drivers 2023-08-03 08:38:07 -07:00
amd ethernet: atarilance: mark init function static 2023-08-11 18:24:02 -07:00
apm net/xgene: fix Wvoid-pointer-to-enum-cast warning 2023-08-11 09:58:45 +01:00
apple net/macmace: Replace zero-length array with DECLARE_FLEX_ARRAY() helper 2023-08-01 14:46:21 -07:00
aquantia net: atlantic: Remove unnecessary (void*) conversions 2023-07-18 19:00:47 -07:00
arc net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
asix
atheros net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
broadcom tg3: Use pci_dev_id() to simplify the code 2023-08-13 12:30:39 +01:00
brocade Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-07-20 15:52:55 -07:00
cadence net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
calxeda
cavium Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
chelsio net: flow_dissector: Use 64bits for used_keys 2023-07-31 09:11:24 +01:00
cirrus cirrus: cs89x0: fix the return value handle and remove redundant dev_warn() for platform_get_irq() 2023-08-02 12:10:39 -07:00
cisco
cortina net: gemini: Remove redundant of_match_ptr() 2023-08-16 09:59:40 +01:00
davicom
dec
dlink
emulex rtnetlink: remove redundant checks for nlattr IFLA_BRIDGE_MODE 2023-08-08 15:10:37 -07:00
engleder page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00
ezchip net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
faraday net: ftmac100: add multicast filtering possibility 2023-08-11 06:58:31 +01:00
freescale net: fec: improve XDP_TX performance 2023-08-16 07:12:39 +01:00
fujitsu
fungible eth: add missing xdp.h includes in drivers 2023-08-03 08:38:07 -07:00
google gve: RX path for DQO-QPL 2023-08-06 08:34:36 +01:00
hisilicon net: hns3: fix wrong rpu tln reg issue 2023-08-16 08:56:38 +01:00
huawei
i825xx
ibm Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-10 14:10:53 -07:00
intel virtchnl: fix fake 1-elem arrays in structures allocated as `nents + 1` 2023-08-16 09:05:04 -07:00
litex
marvell octeontx2-pf: Allow both ntuple and TC features on the interface 2023-08-11 11:54:41 +01:00
mediatek page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00
mellanox net/mlx5: Don't query MAX caps twice 2023-08-14 14:40:22 -07:00
micrel
microchip page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00
microsoft net: mana: Add gdma stats to ethtool output for mana 2023-08-11 09:53:59 +01:00
moxa
mscc net: flow_dissector: Use 64bits for used_keys 2023-07-31 09:11:24 +01:00
myricom
natsemi
neterion ethernet: s2io: Use ether_addr_to_u64() to convert ethernet address 2023-08-09 15:26:49 -07:00
netronome rtnetlink: remove redundant checks for nlattr IFLA_BRIDGE_MODE 2023-08-08 15:10:37 -07:00
ni net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
nvidia
nxp
oki-semi
packetengines
pasemi
pensando Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-10 14:10:53 -07:00
qlogic qed: remove unused 'resp_size' calculation 2023-08-15 19:04:36 -07:00
qualcomm net: qualcomm: Remove redundant of_match_ptr() 2023-08-16 09:59:40 +01:00
rdc
realtek Revert "r8169: disable ASPM during NAPI poll" 2023-07-19 21:09:11 -07:00
renesas net: renesas: rswitch: Add .[gs]et_link_ksettings support 2023-08-08 15:31:52 -07:00
rocker
samsung
seeq
sfc sfc: offload left-hand side rules for conntrack 2023-08-09 11:14:38 +01:00
sgi
silan
sis
smsc net: smsc: Use pci_dev_id() to simplify the code 2023-08-13 12:30:39 +01:00
socionext page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00
stmicro net: stmmac: xgmac: show more MAC HW features in debugfs 2023-08-14 08:09:00 +01:00
sun ethernet: ldmvsw: mark ldmvsw_open() static 2023-08-11 18:24:02 -07:00
sunplus
synopsys
tehuti
ti net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode 2023-08-16 12:17:49 +01:00
toshiba net: tc35815: Use pci_dev_id() to simplify the code 2023-08-13 12:30:39 +01:00
tundra
vertexcom
via net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
wangxun net: ngbe: use pci_dev_id() to simplify the code 2023-08-13 12:30:39 +01:00
wiznet
xilinx Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-03 14:34:37 -07:00
xircom
xscale
Kconfig
Makefile
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c
jme.h
korina.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-03 14:34:37 -07:00
lantiq_etop.c
lantiq_xrx200.c