diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2014-07-22 18:01:52 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-23 02:59:19 (GMT) |
commit | 474ea9cafc459976827a477f2c30eaf6313cb7c1 (patch) | |
tree | d3a3e6cb9bf04397c8ae7f45a6a36276d2a0f956 /drivers/net/ethernet/broadcom/genet/bcmgenet.c | |
parent | 1be9a950c646c9092fb3618197f7b6bfb50e82aa (diff) | |
download | linux-474ea9cafc459976827a477f2c30eaf6313cb7c1.tar.xz |
net: bcmgenet: correctly pad short packets
Packets shorter than ETH_ZLEN were not padded with zeroes, hence leaking
potentially sensitive information. This bug has been present since the
driver got accepted in commit 1c1008c793fa46703a2fee469f4235e1c7984333
("net: bcmgenet: add main driver file").
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/genet/bcmgenet.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/genet/bcmgenet.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 16281ad..4e615de 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -1149,6 +1149,11 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) goto out; } + if (skb_padto(skb, ETH_ZLEN)) { + ret = NETDEV_TX_OK; + goto out; + } + /* set the SKB transmit checksum */ if (priv->desc_64b_en) { ret = bcmgenet_put_tx_csum(dev, skb); |