lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1341866003.2535.60.camel@bwh-desktop.uk.solarflarecom.com>
Date:	Mon, 9 Jul 2012 21:33:23 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Andy Cress <andy.cress@...kontron.com>
CC:	<netdev@...r.kernel.org>
Subject: Re: [PATCH 4/4] pch_gbe: vlan skb len fix

On Mon, 2012-07-09 at 06:30 -0700, Andy Cress wrote:
> Author: Veaceslav Falico <vfalico@...hat.com>
> Date:   Tue Apr 10 08:14:17 2012 +0200
> 
>     pch_gbe: correctly verify skb->len in vlan case
>              to avoid bogus transfer length errors.

This check shouldn't be necessary at all.  Maybe you should remove it
instead of correcting the check?

Also, these patches are word-wrapped, and would not be applicable in
this form.  See Documentation/email-clients.txt.

Ben.

> Signed-off-by: Andy Cress <andy.cress@...kontron.com>
> 
> diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> index 30ef285..04b0e49 100644
> --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> @@ -2158,8 +2158,10 @@ static int pch_gbe_xmit_frame(struct sk_buff
> *skb, struct net_device *netdev)
>  	struct pch_gbe_adapter *adapter = netdev_priv(netdev);
>  	struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring;
>  	unsigned long flags;
> +	int offset;
>  
> -	if (unlikely(skb->len > (adapter->hw.mac.max_frame_size - 4))) {
> +	offset = skb->protocol == htons(ETH_P_8021Q) ? 0 : 4;
> +	if (unlikely(skb->len > (adapter->hw.mac.max_frame_size -
> offset))) {
>  		pr_err("Transfer length Error: skb len: %d > max: %d\n",
>  		       skb->len, adapter->hw.mac.max_frame_size);
>  		dev_kfree_skb_any(skb);

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ