linux/drivers/net
Gustavo A. R. Silva 5de3a2386e net: tulip: Replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 7649773293 ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-05 14:55:48 -08:00
..
appletalk
arcnet
bonding net/bond: Delete driver and module versions 2020-02-24 11:23:36 -08:00
caif
can ioremap changes for 5.6 2020-01-27 13:03:00 -08:00
dsa net: dsa: felix: Allow unknown unicast traffic towards the CPU port module 2020-03-04 14:19:01 -08:00
ethernet net: tulip: Replace zero-length array with flexible-array member 2020-03-05 14:55:48 -08:00
fddi net: skfp: use new constant PCI_STATUS_ERROR_BITS 2020-03-04 14:21:00 -08:00
fjes Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-01-28 16:02:33 -08:00
hamradio
hippi
hyperv net/ethtool: Introduce link_ksettings API for virtual network devices 2020-02-29 21:48:55 -08:00
ieee802154
ipvlan
netdevsim netdevsim: add ACL trap reporting cookie as a metadata 2020-02-25 11:05:55 -08:00
phy net: phy: marvell10g: place in powersave mode at probe 2020-03-04 14:41:52 -08:00
plip
ppp
slip slip: not call free_netdev before rtnl_unlock in slip_open 2020-02-26 20:37:06 -08:00
team
usb r8152: Replace zero-length array with flexible-array member 2020-03-02 11:16:28 -08:00
vmxnet3 vmxnet3: use new helper tcp_v6_gso_csum_prep 2020-02-19 11:21:00 -08:00
wan WAN: Replace zero-length array with flexible-array member 2020-02-27 12:06:55 -08:00
wimax
wireguard wireguard: socket: remove extra call to synchronize_net 2020-02-16 19:21:56 -08:00
wireless mac80211_hwsim: enable Beacon protection 2020-02-24 10:40:00 +01:00
xen-netback
bareudp.c bareudp: Fix uninitialized variable warnings. 2020-02-24 14:40:54 -08:00
dummy.c net/dummy: Ditch driver and module versions 2020-02-24 11:23:36 -08:00
eql.c
geneve.c
gtp.c gtp: use icmp_ndo_send helper 2020-02-13 14:19:00 -08:00
ifb.c
Kconfig net: UDP tunnel encapsulation module for tunnelling different protocols like MPLS, IP, NSH etc. 2020-02-24 13:31:42 -08:00
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
macvtap.c
Makefile net: UDP tunnel encapsulation module for tunnelling different protocols like MPLS, IP, NSH etc. 2020-02-24 13:31:42 -08:00
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: Remove unnecessary BUG_ON check in tun_net_xmit 2020-02-23 16:39:21 -08:00
veth.c
virtio_net.c virtio_net: reject unsupported coalescing params 2020-03-05 12:12:35 -08:00
vrf.c
vsockmon.c
vxlan.c
xen-netfront.c