linux/drivers/net
Len Baker 9eb4c320be nfp: Prefer struct_size over open coded arithmetic
As noted in the "Deprecated Interfaces, Language Features, Attributes,
and Conventions" documentation [1], size calculations (especially
multiplication) should not be performed in memory allocator (or similar)
function arguments due to the risk of them overflowing. This could lead
to values wrapping around and a smaller allocation being made than the
caller was expecting. Using those allocations could lead to linear
overflows of heap memory and other misbehaviors.

So, use the struct_size() helper to do the arithmetic instead of the
argument "size + count * size" in the kzalloc() function.

[1] https://www.kernel.org/doc/html/v5.14/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments

Signed-off-by: Len Baker <len.baker@gmx.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-09-13 13:02:38 +01:00
..
appletalk make legacy ISA probe optional 2021-08-03 13:05:26 +01:00
arcnet
bonding bonding: 3ad: pass parameter bond_params by reference 2021-09-07 10:28:50 +01:00
caif
can can: c_can: fix null-ptr-deref on ioctl() 2021-09-07 08:46:58 +02:00
dsa net: dsa: b53: Fix IMP port setup on BCM5301x 2021-09-05 19:02:38 +01:00
ethernet nfp: Prefer struct_size over open coded arithmetic 2021-09-13 13:02:38 +01:00
fddi fddi: switch from 'pci_' to 'dma_' API 2021-08-29 10:50:24 +01:00
fjes
hamradio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-19 18:09:18 -07:00
hippi hippi: use ndo_siocdevprivate 2021-07-27 20:11:44 +01:00
hyperv
ieee802154
ipa net: ipa: rename "ipa_clock.c" 2021-08-22 09:44:17 +01:00
ipvlan ipvlan: Add handling of NETDEV_UP events 2021-07-29 22:17:37 +01:00
mctp mctp: Add initial driver infrastructure 2021-07-29 15:06:50 +01:00
mdio net: mdio: mscc-miim: Make use of the helper function devm_platform_ioremap_resource() 2021-08-31 12:07:05 +01:00
netdevsim Driver core update for 5.15-rc1 2021-09-01 08:44:42 -07:00
pcs net: pcs: xpcs: Add Pause Mode support for SGMII and 2500BaseX 2021-08-16 11:03:22 +01:00
phy net: phylink: add suspend/resume support 2021-09-07 14:04:59 +01:00
plip slip/plip: use ndo_siocdevprivate 2021-07-27 20:11:44 +01:00
ppp bpf: Refactor BPF_PROG_RUN into a function 2021-08-17 00:45:07 +02:00
slip slip/plip: use ndo_siocdevprivate 2021-07-27 20:11:44 +01:00
team bpf: Refactor BPF_PROG_RUN into a function 2021-08-17 00:45:07 +02:00
usb Networking stragglers and fixes for 5.15-rc1, including changes from netfilter, 2021-09-07 14:02:58 -07:00
vmxnet3 ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
wan wan: hostess_sv11: use module_init/module_exit helpers 2021-08-03 13:05:26 +01:00
wireguard
wireless Networking stragglers and fixes for 5.15-rc1, including changes from netfilter, 2021-09-07 14:02:58 -07:00
wwan Networking stragglers and fixes for 5.15-rc1, including changes from netfilter, 2021-09-07 14:02:58 -07:00
xen-netback
bareudp.c bareudp: Fix invalid read beyond skb's linear data 2021-08-09 15:37:43 -07:00
dummy.c
eql.c eql: use ndo_siocdevprivate 2021-07-27 20:11:43 +01:00
geneve.c
gtp.c
ifb.c
Kconfig net: Kconfig: remove obsolete reference to config MICROBLAZE_64K_PAGES 2021-08-13 16:30:35 -07:00
LICENSE.SRC
loopback.c
macsec.c
macvlan.c dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
macvtap.c
Makefile net: mhi: Remove MBIM protocol 2021-08-04 10:10:12 +01:00
mdio.c
mhi_net.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-26 17:57:57 -07:00
mii.c net: mii: make mii_ethtool_gset() return void 2021-08-19 13:06:53 +01:00
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c sb1000: use ndo_siocdevprivate 2021-07-27 20:11:44 +01:00
Space.c wan: remove sbni/granch driver 2021-08-03 13:05:26 +01:00
sungem_phy.c
tap.c
thunderbolt.c
tun.c ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
veth.c veth: use skb_prepare_for_gro() 2021-07-29 12:18:12 +01:00
virtio_net.c virtio_net: reduce raw_smp_processor_id() calling in virtnet_xdp_get_sq 2021-08-29 10:53:45 +01:00
vrf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-19 18:09:18 -07:00
vsockmon.c
vxlan.c
xen-netfront.c xen/netfront: don't trust the backend response data blindly 2021-08-25 10:43:21 +01:00