[PATCH 3.19.y-ckt 018/164] ipv4: disable BH when changing ip local port range

2015-12-02 Thread Kamal Mostafa
3.19.8-ckt11 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: WANG Cong 

[ Upstream commit 4ee3bd4a8c7463cdef0b82ebc33fc94a9170a7e0 ]

This fixes the following lockdep warning:

 [ INFO: inconsistent lock state ]
 4.3.0-rc7+ #1197 Not tainted
 -
 inconsistent {IN-SOFTIRQ-R} -> {SOFTIRQ-ON-W} usage.
 sysctl/1019 [HC0[0]:SC0[0]:HE1:SE1] takes:
  (&(>ipv4.ip_local_ports.lock)->seqcount){+.+-..}, at: 
[] ipv4_local_port_range+0xb4/0x12a
 {IN-SOFTIRQ-R} state was registered at:
   [] __lock_acquire+0x2f6/0xdf0
   [] lock_acquire+0x11c/0x1a4
   [] inet_get_local_port_range+0x4e/0xae
   [] udp_flow_src_port.constprop.40+0x23/0x116
   [] vxlan_xmit_one+0x219/0xa6a
   [] vxlan_xmit+0xa6b/0xaa5
   [] dev_hard_start_xmit+0x2ae/0x465
   [] __dev_queue_xmit+0x531/0x633
   [] dev_queue_xmit_sk+0x13/0x15
   [] neigh_resolve_output+0x12f/0x14d
   [] ip6_finish_output2+0x344/0x39f
   [] ip6_finish_output+0x88/0x8e
   [] ip6_output+0x91/0xe5
   [] dst_output_sk+0x47/0x4c
   [] NF_HOOK_THRESH.constprop.30+0x38/0x82
   [] mld_sendpack+0x189/0x266
   [] mld_ifc_timer_expire+0x1ef/0x223
   [] call_timer_fn+0xfb/0x28c
   [] run_timer_softirq+0x1c7/0x1f1

Fixes: b8f1a55639e6 ("udp: Add function to make source port for UDP tunnels")
Cc: Tom Herbert 
Signed-off-by: Cong Wang 
Signed-off-by: David S. Miller 
Signed-off-by: Kamal Mostafa 
---
 net/ipv4/sysctl_net_ipv4.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index e0ee384..b3ee8ee 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -45,10 +45,10 @@ static int ip_ping_group_range_max[] = { GID_T_MAX, 
GID_T_MAX };
 /* Update system visible IP port range */
 static void set_local_port_range(struct net *net, int range[2])
 {
-   write_seqlock(>ipv4.ip_local_ports.lock);
+   write_seqlock_bh(>ipv4.ip_local_ports.lock);
net->ipv4.ip_local_ports.range[0] = range[0];
net->ipv4.ip_local_ports.range[1] = range[1];
-   write_sequnlock(>ipv4.ip_local_ports.lock);
+   write_sequnlock_bh(>ipv4.ip_local_ports.lock);
 }
 
 /* Validate changes from /proc interface. */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.19.y-ckt 018/164] ipv4: disable BH when changing ip local port range

2015-12-02 Thread Kamal Mostafa
3.19.8-ckt11 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: WANG Cong 

[ Upstream commit 4ee3bd4a8c7463cdef0b82ebc33fc94a9170a7e0 ]

This fixes the following lockdep warning:

 [ INFO: inconsistent lock state ]
 4.3.0-rc7+ #1197 Not tainted
 -
 inconsistent {IN-SOFTIRQ-R} -> {SOFTIRQ-ON-W} usage.
 sysctl/1019 [HC0[0]:SC0[0]:HE1:SE1] takes:
  (&(>ipv4.ip_local_ports.lock)->seqcount){+.+-..}, at: 
[] ipv4_local_port_range+0xb4/0x12a
 {IN-SOFTIRQ-R} state was registered at:
   [] __lock_acquire+0x2f6/0xdf0
   [] lock_acquire+0x11c/0x1a4
   [] inet_get_local_port_range+0x4e/0xae
   [] udp_flow_src_port.constprop.40+0x23/0x116
   [] vxlan_xmit_one+0x219/0xa6a
   [] vxlan_xmit+0xa6b/0xaa5
   [] dev_hard_start_xmit+0x2ae/0x465
   [] __dev_queue_xmit+0x531/0x633
   [] dev_queue_xmit_sk+0x13/0x15
   [] neigh_resolve_output+0x12f/0x14d
   [] ip6_finish_output2+0x344/0x39f
   [] ip6_finish_output+0x88/0x8e
   [] ip6_output+0x91/0xe5
   [] dst_output_sk+0x47/0x4c
   [] NF_HOOK_THRESH.constprop.30+0x38/0x82
   [] mld_sendpack+0x189/0x266
   [] mld_ifc_timer_expire+0x1ef/0x223
   [] call_timer_fn+0xfb/0x28c
   [] run_timer_softirq+0x1c7/0x1f1

Fixes: b8f1a55639e6 ("udp: Add function to make source port for UDP tunnels")
Cc: Tom Herbert 
Signed-off-by: Cong Wang 
Signed-off-by: David S. Miller 
Signed-off-by: Kamal Mostafa 
---
 net/ipv4/sysctl_net_ipv4.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index e0ee384..b3ee8ee 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -45,10 +45,10 @@ static int ip_ping_group_range_max[] = { GID_T_MAX, 
GID_T_MAX };
 /* Update system visible IP port range */
 static void set_local_port_range(struct net *net, int range[2])
 {
-   write_seqlock(>ipv4.ip_local_ports.lock);
+   write_seqlock_bh(>ipv4.ip_local_ports.lock);
net->ipv4.ip_local_ports.range[0] = range[0];
net->ipv4.ip_local_ports.range[1] = range[1];
-   write_sequnlock(>ipv4.ip_local_ports.lock);
+   write_sequnlock_bh(>ipv4.ip_local_ports.lock);
 }
 
 /* Validate changes from /proc interface. */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/