Skip to contentSkip to conversation

: xt_helper: Do not bypass RCU

NETFILTER Applied Patrick McHardy 3 participants 5 messages Jan 10, 2008 – Jan 11, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

[MACVLAN]: Prevent nesting macvlan devices

Don't allow to nest macvlan devices since it will cause lockdep warnings and isn't really useful for anything.

---
commit 80a76fbde679793a17482a3dd842386801fca66b
tree 07f67e78ac0ae505a5de81e7e770a1b7d597f120
parent 4d14fded63dcaf9d5dcf78e2a8ea3f5de2c29eb9
author Patrick McHardy <[email protected]> Thu, 10 Jan 2008 16:25:01 +0100 committer Patrick McHardy <[email protected]> Thu, 10 Jan 2008 16:25:01 +0100

 drivers/net/macvlan.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/net/macvlan.c +7 -0
index 2e4bcd5..e8dc2f4 100644
@@ -384,6 +384,13 @@ static int macvlan_newlink(struct net_device *dev,
 	if (lowerdev == NULL)
 		return -ENODEV;
 
+	/* Don't allow macvlans on top of other macvlans - its not really
+	 * wrong, but lockdep can't handle it and its not useful for anything
+	 * you couldn't do directly on top of the real device.
+	 */
+	if (lowerdev->rtnl_link_ops == dev->rtnl_link_ops)
+		return -ENODEV;
+
 	if (!tb[IFLA_MTU])
 		dev->mtu = lowerdev->mtu;
 	else if (dev->mtu > lowerdev->mtu)
#2 lore raw
Quoted 11 lines · Jan Engelhardt
Quoted 8 lines · Patrick McHardy

Date: Thu, 10 Jan 2008 16:45:41 +0100
From: Patrick McHardy <[email protected]>
To: David S. Miller <[email protected]>
Cc: Netfilter Development Mailinglist <[email protected]>
Subject: [NETFILTER]: xt_helper: Do not bypass RCU

Quoted 1 line

Hm subject does not match the patch.

Oops sorry, sent patches from the wrong directory. I'll resend both.

#3 lore raw
In reply to Patrick McHardy

[NETFILTER]: xt_helper: Do not bypass RCU

Use the @helper variable that was just obtained.

---
commit 30d0a14997210d0c2cbaea594eb1283d773dfca5
tree 5270a79c2e2bfd679b96edba59c6b7ef84e59bdb
parent 7bd5c38839308e24911fffa749b3e53391c7de14
author Jan Engelhardt <[email protected]> Wed, 02 Jan 2008 21:29:12 +0100 committer Patrick McHardy <[email protected]> Thu, 10 Jan 2008 16:44:14 +0100

 net/netfilter/xt_helper.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/netfilter/xt_helper.c +2 -2
index 0a1f4c6..d842c4a 100644
@@ -56,8 +56,8 @@ match(const struct sk_buff *skb,
 	if (info->name[0] == '\0')
 		ret = !ret;
 	else
-		ret ^= !strncmp(master_help->helper->name, info->name,
-				strlen(master_help->helper->name));
+		ret ^= !strncmp(helper->name, info->name,
+				strlen(helper->name));
 	return ret;
 }