[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FD5BC1D.8040805@antcom.de>
Date: Mon, 11 Jun 2012 11:36:29 +0200
From: Roland Stigge <stigge@...com.de>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>, kevin.wells@....com,
aletes.xgr@...il.com, srinivas.bakki@....com
Subject: Re: [PATCH] lpc_eth: add missing ndo_change_mtu()
On 06/11/2012 11:24 AM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
>
> 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@...gle.com>
Acked-by: Roland Stigge <stigge@...com.de>
> Cc: Roland Stigge <stigge@...com.de>
> Cc: Kevin Wells <kevin.wells@....com>
> ---
> diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
> index 8d2666f..10febdc 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 = {
> .ndo_set_rx_mode = lpc_eth_set_multicast_list,
> .ndo_do_ioctl = lpc_eth_ioctl,
> .ndo_set_mac_address = lpc_set_mac_address,
> + .ndo_change_mtu = eth_change_mtu,
> };
>
> static int lpc_eth_drv_probe(struct platform_device *pdev)
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists