diff options
author | Eric Dumazet <edumazet@google.com> | 2012-06-10 19:24:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-11 16:12:26 -0400 |
commit | e30478598a8476d02e3b00caa89ce1a3b1dad54b (patch) | |
tree | 07344e1c01b5f42ec78fc62b49ca37b9052d1ce6 /drivers | |
parent | ed6be3dcfee0bb891efd6ea908ca32bea711085b (diff) |
lpc_eth: add missing ndo_change_mtu()
lpc_eth does a copy of transmitted skbs to DMA area, without checking
skb lengths, so can trigger buffer overflows :
memcpy(pldat->tx_buff_v + txidx * ENET_MAXF_SIZE, skb->data, len);
One way to get bigger skbs is to allow MTU changes above the 1500 limit.
Calling eth_change_mtu() in ndo_change_mtu() makes sure this cannot
happen.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Roland Stigge <stigge@antcom.de>
Cc: Kevin Wells <kevin.wells@nxp.com>
Acked-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/nxp/lpc_eth.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index 8d2666fcffd7..10febdc2bd1a 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c | |||
@@ -1320,6 +1320,7 @@ static const struct net_device_ops lpc_netdev_ops = { | |||
1320 | .ndo_set_rx_mode = lpc_eth_set_multicast_list, | 1320 | .ndo_set_rx_mode = lpc_eth_set_multicast_list, |
1321 | .ndo_do_ioctl = lpc_eth_ioctl, | 1321 | .ndo_do_ioctl = lpc_eth_ioctl, |
1322 | .ndo_set_mac_address = lpc_set_mac_address, | 1322 | .ndo_set_mac_address = lpc_set_mac_address, |
1323 | .ndo_change_mtu = eth_change_mtu, | ||
1323 | }; | 1324 | }; |
1324 | 1325 | ||
1325 | static int lpc_eth_drv_probe(struct platform_device *pdev) | 1326 | static int lpc_eth_drv_probe(struct platform_device *pdev) |