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 1c1008c793
("net: bcmgenet: add main driver file").
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1be9a950c6
commit
474ea9cafc
1 changed files with 5 additions and 0 deletions
|
@ -1149,6 +1149,11 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (skb_padto(skb, ETH_ZLEN)) {
|
||||||
|
ret = NETDEV_TX_OK;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
/* set the SKB transmit checksum */
|
/* set the SKB transmit checksum */
|
||||||
if (priv->desc_64b_en) {
|
if (priv->desc_64b_en) {
|
||||||
ret = bcmgenet_put_tx_csum(dev, skb);
|
ret = bcmgenet_put_tx_csum(dev, skb);
|
||||||
|
|
Loading…
Add table
Reference in a new issue