From: Roland Stigge <stigge@antcom•de>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: David Miller <davem@davemloft•net>,
netdev <netdev@vger•kernel.org>,
kevin.wells@nxp•com, aletes.xgr@gmail•com,
srinivas.bakki@nxp•com
Subject: Re: [PATCH] lpc_eth: add missing ndo_change_mtu()
Date: Mon, 11 Jun 2012 11:36:29 +0200 [thread overview]
Message-ID: <4FD5BC1D.8040805@antcom.de> (raw)
In-Reply-To: <1339406640.6001.1896.camel@edumazet-glaptop>
On 06/11/2012 11:24 AM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google•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@google•com>
Acked-by: Roland Stigge <stigge@antcom•de>
> Cc: Roland Stigge <stigge@antcom•de>
> Cc: Kevin Wells <kevin.wells@nxp•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)
>
>
next prev parent reply other threads:[~2012-06-11 9:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-11 9:24 [PATCH] lpc_eth: add missing ndo_change_mtu() Eric Dumazet
2012-06-11 9:36 ` Roland Stigge [this message]
2012-06-11 20:13 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FD5BC1D.8040805@antcom.de \
--to=stigge@antcom$(echo .)de \
--cc=aletes.xgr@gmail$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=eric.dumazet@gmail$(echo .)com \
--cc=kevin.wells@nxp$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=srinivas.bakki@nxp$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox