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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1329851622.2689.6.camel@bwh-desktop>
Date:	Tue, 21 Feb 2012 19:13:42 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	David Miller <davem@...emloft.net>
CC:	<netdev@...r.kernel.org>, Shradha Shah <sshah@...arflare.com>,
	Patrick McHardy <kaber@...sh.net>,
	"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: [PATCH net] macvlan: Disable LRO on lowerdev; warn if it's turned
 back on

Large Receive Offload (LRO) is only appropriate for packets that are
destined for the host, and should be disabled if received packets may
be forwarded.

Further, macvtap_skb_to_vnet_hdr() will BUG() on a packet received
with LRO (but not GRO).

Signed-off-by: Ben Hutchings <bhutchings@...arflare.com>
---
I'm not really familiar with macvlan so I'm not certain that this should
be applied to all modes.

Ben.

 drivers/net/macvlan.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 9ea9921..c64e26c 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -168,6 +168,11 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
 	unsigned int len = 0;
 	int ret = NET_RX_DROP;
 
+	if (skb_warn_if_lro(skb)) {
+		kfree_skb(skb);
+		return RX_HANDLER_CONSUMED;
+	}
+
 	port = macvlan_port_get_rcu(skb->dev);
 	if (is_multicast_ether_addr(eth->h_dest)) {
 		skb = ip_check_defrag(skb, IP_DEFRAG_MACVLAN);
@@ -717,6 +722,8 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
 		memcpy(dev->dev_addr, lowerdev->dev_addr, ETH_ALEN);
 	}
 
+	dev_disable_lro(lowerdev);
+
 	port->count += 1;
 	err = register_netdevice(dev);
 	if (err < 0)
-- 
1.7.7.6


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