request for 4.4-stable: 08474cc1e6ea7 ("bridge: Propagate vlan add failure to user")

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Greg,

This patch is not marked for 4.4-stable, but it's already in 4.9 and 4.14 stable. 

Please apply to 4.4-stable.

This patch fixed the kernel oops issue when executing bridge tool, please
see reproducible steps with kernel 4.4 in below. 

# brctl addbr br0
# brctl addif br0 eth0
[ 1073.390028] device eth0 entered promiscuous mode
[ 1073.395022] cpsw 4a100000.ethernet eth0: failed to initialize vlan filtering on this port
# brctl addif br0 eth1
[ 1092.205685] net eth1: promiscuity not disabled as the other interface is still in promiscuity mode
[ 1092.217541] device eth1 entered promiscuous mode
[ 1092.222460] cpsw 4a100000.ethernet eth1: failed to initialize vlan filtering on this port
# ifconfig br0 192.168.127.253 netmask 255.255.254.0
[ 1112.412740] br0: port 1(eth0) entered forwarding state
[ 1112.417975] br0: port 1(eth0) entered forwarding state
# brctl delif br0 eth0
[ 1137.645792] device eth0 left promiscuous mode
[ 1137.650429] net eth0: promiscuity not disabled as the other interface is still in promiscuity mode
[ 1137.663592] br0: port 1(eth0) entered disabled state
[ 1137.668815] Unable to handle kernel NULL pointer dereference at virtual address 0000007a
[ 1137.677026] pgd = dc58c000
[ 1137.679745] [0000007a] *pgd=00000000
[ 1137.683377] Internal error: Oops: 805 [#1] SMP ARM
[ 1137.688189] Modules linked in: cryptodev omap_sham omap_aes omap_wdt sunrpc ip_tables x_tables autofs4
[ 1137.697598] CPU: 0 PID: 851 Comm: brctl Not tainted 4.4.0-cip-uc8100+ #1
[ 1137.704325] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 1137.710442] task: de580dc0 ti: dc574000 task.ti: dc574000
[ 1137.715883] PC is at __vlan_flush+0x18/0x54
[ 1137.720084] LR is at nbp_vlan_flush+0x28/0x60
[ 1137.724457] pc : [<c051ab3c>]    lr : [<c051c2f4>]    psr: 20080013
[ 1137.724457] sp : dc575dc8  ip : dc575de0  fp : dc575ddc
[ 1137.735981] r10: 00000000  r9 : 00000000  r8 : 00000000
[ 1137.741226] r7 : dc5236d4  r6 : de239800  r5 : 00000000  r4 : 00000000
[ 1137.747779] r3 : 00000000  r2 : dc49e4c4  r1 : 00000200  r0 : 00000000
[ 1137.754333] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[ 1137.761497] Control: 10c5387d  Table: 9c58c019  DAC: 00000051
[ 1137.767264] Process brctl (pid: 851, stack limit = 0xdc574218)
[ 1137.773119] Stack: (0xdc575dc8 to 0xdc576000)
[ 1137.777496] 5dc0:                   00000000 dc523600 dc575df4 dc575de0 c051c2f4 c051ab30
[ 1137.785711] 5de0: dc523600 dc49e4c0 dc575e14 dc575df8 c050e450 c051c2d8 dc49e4c0 dc49e4c0
[ 1137.793925] 5e00: 00000002 00000000 dc575e2c dc575e18 c050ebd8 c050e3d0 c0748380 dc49e4c0
[ 1137.802139] 5e20: dc575e4c dc575e30 c050f69c c050ebac dc575ea8 dc49e000 dc575ea8 c0596714
[ 1137.810353] 5e40: dc575e64 dc575e50 c05100f4 c050f650 000089a3 dc49e000 dc575e9c dc575e68
[ 1137.818567] 5e60: c04293d0 c05100a0 c0409b84 c0265738 dc575ea8 c0748380 000089a3 000089a3
[ 1137.826781] 5e80: c0748380 bee56bf4 dc575ea8 00000000 dc575ef4 dc575ea0 c0429828 c0429118
[ 1137.834995] 5ea0: 00000001 d543b3b8 00307262 00000000 00000000 00000000 00000002 00000003
[ 1137.843210] 5ec0: 7f5b0e34 bee56ebf c0147120 000089a3 fffffdfd bee56bf4 c0748380 bee56bf4
[ 1137.851424] 5ee0: 00000003 00000000 dc575f14 dc575ef8 c03f3230 c0429494 bee56bf4 ddb840a0
[ 1137.859638] 5f00: dc4ca340 00000003 dc575f7c dc575f18 c0142c08 c03f30b0 dc575f5c dc575f28
[ 1137.867852] 5f20: c0131f08 c01509ac 00000020 00000000 dc575f54 de581244 00000000 c0754108
[ 1137.876067] 5f40: de580dc0 c000fa64 dc574000 00000000 dc575f6c 00000000 dc4ca340 dc4ca340
[ 1137.884281] 5f60: 000089a3 bee56bf4 00000003 00000000 dc575fa4 dc575f80 c0142e98 c0142724
[ 1137.892495] 5f80: 7f5b10f0 b6f7ace8 00000002 00000036 c000fa64 dc574000 00000000 dc575fa8
[ 1137.900708] 5fa0: c000f8a0 c0142e30 7f5b10f0 b6f7ace8 00000003 000089a3 bee56bf4 000000cc
[ 1137.908922] 5fc0: 7f5b10f0 b6f7ace8 00000002 00000036 bee56bf4 00000000 7f5b1000 00000000
[ 1137.917136] 5fe0: b6ef4711 bee56bdc 7f59f1ff b6ef4716 00080030 00000003 00000000 00000000
[ 1137.925343] Backtrace:
[ 1137.927810] [<c051ab24>] (__vlan_flush) from [<c051c2f4>] (nbp_vlan_flush+0x28/0x60)
[ 1137.935582]  r5:dc523600 r4:00000000
[ 1137.939194] [<c051c2cc>] (nbp_vlan_flush) from [<c050e450>] (del_nbp+0x8c/0x110)
[ 1137.946618]  r5:dc49e4c0 r4:dc523600
[ 1137.950224] [<c050e3c4>] (del_nbp) from [<c050ebd8>] (br_del_if+0x38/0x9c)
[ 1137.957125]  r7:00000000 r6:00000002 r5:dc49e4c0 r4:dc49e4c0
[ 1137.962833] [<c050eba0>] (br_del_if) from [<c050f69c>] (add_del_if+0x58/0x74)
[ 1137.969995]  r5:dc49e4c0 r4:c0748380
[ 1137.973600] [<c050f644>] (add_del_if) from [<c05100f4>] (br_dev_ioctl+0x60/0x64)
[ 1137.981023]  r7:c0596714 r6:dc575ea8 r5:dc49e000 r4:dc575ea8
[ 1137.986731] [<c0510094>] (br_dev_ioctl) from [<c04293d0>] (dev_ifsioc+0x2c4/0x308)
[ 1137.994330]  r5:dc49e000 r4:000089a3
[ 1137.997930] [<c042910c>] (dev_ifsioc) from [<c0429828>] (dev_ioctl+0x3a0/0x8bc)
[ 1138.005266]  r8:00000000 r7:dc575ea8 r6:bee56bf4 r5:c0748380 r4:000089a3
[ 1138.012032] [<c0429488>] (dev_ioctl) from [<c03f3230>] (sock_ioctl+0x18c/0x2dc)
[ 1138.019368]  r10:00000000 r9:00000003 r8:bee56bf4 r7:c0748380 r6:bee56bf4 r5:fffffdfd
[ 1138.027260]  r4:000089a3
[ 1138.029817] [<c03f30a4>] (sock_ioctl) from [<c0142c08>] (do_vfs_ioctl+0x4f0/0x70c)
[ 1138.037416]  r7:00000003 r6:dc4ca340 r5:ddb840a0 r4:bee56bf4
[ 1138.043124] [<c0142718>] (do_vfs_ioctl) from [<c0142e98>] (SyS_ioctl+0x74/0x84)
[ 1138.050460]  r10:00000000 r9:00000003 r8:bee56bf4 r7:000089a3 r6:dc4ca340 r5:dc4ca340
[ 1138.058347]  r4:00000000
[ 1138.060907] [<c0142e24>] (SyS_ioctl) from [<c000f8a0>] (ret_fast_syscall+0x0/0x44)
[ 1138.068505]  r9:dc574000 r8:c000fa64 r7:00000036 r6:00000002 r5:b6f7ace8 r4:7f5b10f0
[ 1138.076311] Code: e24cb004 f57ff05a e1a05000 e3a03000 (e1c037ba)
[ 1138.082666] ---[ end trace d055796b6cd31311 ]---
Segmentation fault

--
SZ Lin (林上智)
>From 3a29c12b3bda966524650faea99d7be0194e8d68 Mon Sep 17 00:00:00 2001
From: Elad Raz <eladr@xxxxxxxxxxxx>
Date: Wed, 6 Jan 2016 13:01:04 +0100
Subject: [PATCH] bridge: Propagate vlan add failure to user

commit 08474cc1e6ea71237cab7e4a651a623c9dea1084 upstream

Disallow adding interfaces to a bridge when vlan filtering operation
failed. Send the failure code to the user.

Signed-off-by: Elad Raz <eladr@xxxxxxxxxxxx>
Signed-off-by: Jiri Pirko <jiri@xxxxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: SZ Lin (林上智) <sz.lin@xxxxxxxx>
---
 net/bridge/br_if.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 3400b1e47668..50e84e634dfe 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -511,8 +511,11 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
 	if (br_fdb_insert(br, p, dev->dev_addr, 0))
 		netdev_err(dev, "failed insert local address bridge forwarding table\n");
 
-	if (nbp_vlan_init(p))
+	err = nbp_vlan_init(p);
+	if (err) {
 		netdev_err(dev, "failed to initialize vlan filtering on this port\n");
+		goto err6;
+	}
 
 	spin_lock_bh(&br->lock);
 	changed_addr = br_stp_recalculate_bridge_id(br);
@@ -533,6 +536,12 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
 
 	return 0;
 
+err6:
+	list_del_rcu(&p->list);
+	br_fdb_delete_by_port(br, p, 0, 1);
+	nbp_update_port_count(br);
+	netdev_upper_dev_unlink(dev, br->dev);
+
 err5:
 	dev->priv_flags &= ~IFF_BRIDGE_PORT;
 	netdev_rx_handler_unregister(dev);
-- 
2.18.0


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux