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-next>] [day] [month] [year] [list]
Date:	Tue, 2 Jun 2009 22:23:35 -0700
From:	Chris Wright <chrisw@...s-sol.org>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org, Herbert Xu <herbert@...dor.apana.org.au>,
	Rusty Russell <rusty@...tcorp.com.au>
Subject: [PATCH] tun: virtio net is not compatible with LRO

The current failure mode for an LRO device bridged to a virtio device
(common for KVM) is BUG().  Rather than crashing the host, we can at
least limp along and give a warning.  lro_flush() will set gso_size,
but no corresponding gso_type, unlike gro which will eventually call
->gro_complete and set up proper gso_type.

Signed-off-by: Chris Wright <chrisw@...s-sol.org>
---
 drivers/net/tun.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 735bf41..17c4516 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -717,8 +717,15 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
 				gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
 			else if (sinfo->gso_type & SKB_GSO_TCPV6)
 				gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
-			else
-				BUG();
+			else {
+				WARN_ONCE(1, "%s: hdr_len %d gso_size %d "
+					   "gso_type %x.  virtio is not "
+					   "compatible with LRO, verify NIC "
+					    "isn't using LRO", __func__,
+					    gso.hdr_len, gso.gso_size,
+					    sinfo->gso_type);
+				return -EINVAL;
+			}
 			if (sinfo->gso_type & SKB_GSO_TCP_ECN)
 				gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN;
 		} else
--
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