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>] [day] [month] [year] [list]
Date:	Mon, 13 Jan 2014 13:54:13 +0200
From:	"Vitaly V. Bursov" <vitalyb@...enet.dn.ua>
To:	linux-kernel@...r.kernel.org
Subject: [PATCH] GARP protocol should not send PDUs larger than MTU

If a network interface has many vlan sub-interfaces (~400 or more) with enabled
GVRP, PDUs may become larger than the interface PDU. GARP packet generator
can send multiple PDUs, but it relies heavily on skb_tailroom() not
exceeding maximal packet size.

Patch to fix this issue is proposed, I'm not sure if it's a correct
way to handle this situation, but after a short test looks like it
works - now I get multiple PDUs with maximum size of a 1514 bytes
(1500 MTU) and switch recognizes them now.

MRP protocol can have the same problem, but I can't test it.


Signed-Off-By: Vitaly V. Bursov <vitalyb@...enet.dn.ua>

--- a/net/802/garp.c	2014-01-13 12:55:07.000000000 +0200
+++ b/net/802/garp.c	2014-01-13 12:58:30.000000000 +0200
@@ -210,6 +210,7 @@
  {
  	struct sk_buff *skb;
  	struct garp_pdu_hdr *gp;
+	int extra_size;

  #define LLC_RESERVE	sizeof(struct llc_pdu_un)
  	skb = alloc_skb(app->dev->mtu + LL_RESERVED_SPACE(app->dev),
@@ -221,6 +222,13 @@
  	skb->protocol = htons(ETH_P_802_2);
  	skb_reserve(skb, LL_RESERVED_SPACE(app->dev) + LLC_RESERVE);

+	/* Reserve extra space to avoid PDUs larger than MTU,
+	 * Other code depends on skb_tailroom() to return exact
+	 * usable packet space left */
+	extra_size = skb_tailroom(skb) - (app->dev->mtu - LLC_RESERVE);
+	if (extra_size > 0)
+	    skb_reserve(skb, extra_size);
+
  	gp = (struct garp_pdu_hdr *)__skb_put(skb, sizeof(*gp));
  	put_unaligned(htons(GARP_PROTOCOL_ID), &gp->protocol);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ