linux-stable/drivers/net
Jakub Kicinski f8d0efb112 nfp: don't pad strings in nfp_cpp_resource_find() to avoid gcc 8 warning
Once upon a time nfp_cpp_resource_find() took a name parameter,
which could be any user-chosen string.  Resources are identified
by a CRC32 hash of a 8 byte string, so we had to pad user input
with zeros to make sure CRC32 gave the correct result.

Since then nfp_cpp_resource_find() was made to operate on allocated
resources only (struct nfp_resource).  We kzalloc those so there is
no need to pad the strings and use memcmp.

This avoids a GCC 8 stringop-truncation warning:

In function ‘nfp_cpp_resource_find’,
    inlined from ‘nfp_resource_try_acquire’ at .../nfpcore/nfp_resource.c:153:8,
    inlined from ‘nfp_resource_acquire’ at .../nfpcore/nfp_resource.c:206:9:
    .../nfpcore/nfp_resource.c:108:2: warning:  strncpy’ output may be truncated copying 8 bytes from a string of length 8 [-Wstringop-truncation]
      strncpy(name_pad, res->name, sizeof(name_pad));
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-06-12 15:18:28 -07:00
..
appletalk
arcnet
bonding bonding: re-evaluate force_primary when the primary slave name changes 2018-06-07 16:47:10 -04:00
caif
can - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
dsa net: dsa: b53: Fix for brcm tag issue in Cygnus SoC 2018-06-06 13:47:16 -04:00
ethernet nfp: don't pad strings in nfp_cpp_resource_find() to avoid gcc 8 warning 2018-06-12 15:18:28 -07:00
fddi net: fddi: fix a possible null-ptr-deref 2018-06-08 18:47:46 -04:00
fjes
hamradio Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-06-10 19:25:23 -07:00
ieee802154
ipvlan
netdevsim netdevsim: Add extack error message for devlink reload 2018-06-05 12:32:37 -04:00
phy net: phy: dp83822: use BMCR_ANENABLE instead of BMSR_ANEGCAPABLE for DP83620 2018-06-10 12:38:03 -07:00
plip
ppp Merge branch 'work.aio-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-06-04 13:57:43 -07:00
slip
team team: use netdev_features_t instead of u32 2018-06-04 17:30:04 -04:00
usb cdc_ncm: avoid padding beyond end of skb 2018-06-08 19:50:01 -04:00
vmxnet3
wan wan/fsl_ucc_hdlc: use dma_zalloc_coherent instead of allocator/memset 2018-06-04 17:27:59 -04:00
wimax
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
xen-netback
dummy.c
eql.c
geneve.c
gtp.c
ifb.c ifb: fix packets checksum 2018-05-28 23:02:22 -04:00
Kconfig virtio_net: Extend virtio to use VF datapath when available 2018-05-28 22:59:54 -04:00
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
macvtap.c
Makefile net: Introduce net_failover driver 2018-05-28 22:59:54 -04:00
mdio.c
mii.c
net_failover.c net_failover: Use netdev_features_t instead of u32 2018-06-04 17:30:04 -04:00
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c net: in virtio_net_hdr only add VLAN_HLEN to csum_start if payload holds vlan 2018-06-07 16:15:38 -04:00
thunderbolt.c
tun.c net: in virtio_net_hdr only add VLAN_HLEN to csum_start if payload holds vlan 2018-06-07 16:15:38 -04:00
veth.c
virtio_net.c net: in virtio_net_hdr only add VLAN_HLEN to csum_start if payload holds vlan 2018-06-07 16:15:38 -04:00
vrf.c vrf: add CRC32c offload to device features 2018-05-28 22:55:13 -04:00
vsockmon.c
vxlan.c
xen-netfront.c