aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-29 23:33:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-29 23:33:20 -0400
commit2a26d99b251b8625d27aed14e97fc10707a3a81f (patch)
tree69eb8aa0476294236ceb8a864be9a697e2303ace /net/tipc
parenta909d3e636995ba7c349e2ca5dbb528154d4ac30 (diff)
parentfceb9c3e38252992bbf1a3028cc2f7b871211533 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Lots of fixes, mostly drivers as is usually the case. 1) Don't treat zero DMA address as invalid in vmxnet3, from Alexey Khoroshilov. 2) Fix element timeouts in netfilter's nft_dynset, from Anders K. Pedersen. 3) Don't put aead_req crypto struct on the stack in mac80211, from Ard Biesheuvel. 4) Several uninitialized variable warning fixes from Arnd Bergmann. 5) Fix memory leak in cxgb4, from Colin Ian King. 6) Fix bpf handling of VLAN header push/pop, from Daniel Borkmann. 7) Several VRF semantic fixes from David Ahern. 8) Set skb->protocol properly in ip6_tnl_xmit(), from Eli Cooper. 9) Socket needs to be locked in udp_disconnect(), from Eric Dumazet. 10) Div-by-zero on 32-bit fix in mlx4 driver, from Eugenia Emantayev. 11) Fix stale link state during failover in NCSCI driver, from Gavin Shan. 12) Fix netdev lower adjacency list traversal, from Ido Schimmel. 13) Propvide proper handle when emitting notifications of filter deletes, from Jamal Hadi Salim. 14) Memory leaks and big-endian issues in rtl8xxxu, from Jes Sorensen. 15) Fix DESYNC_FACTOR handling in ipv6, from Jiri Bohac. 16) Several routing offload fixes in mlxsw driver, from Jiri Pirko. 17) Fix broadcast sync problem in TIPC, from Jon Paul Maloy. 18) Validate chunk len before using it in SCTP, from Marcelo Ricardo Leitner. 19) Revert a netns locking change that causes regressions, from Paul Moore. 20) Add recursion limit to GRO handling, from Sabrina Dubroca. 21) GFP_KERNEL in irq context fix in ibmvnic, from Thomas Falcon. 22) Avoid accessing stale vxlan/geneve socket in data path, from Pravin Shelar" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (189 commits) geneve: avoid using stale geneve socket. vxlan: avoid using stale vxlan socket. qede: Fix out-of-bound fastpath memory access net: phy: dp83848: add dp83822 PHY support enic: fix rq disable tipc: fix broadcast link synchronization problem ibmvnic: Fix missing brackets in init_sub_crq_irqs ibmvnic: Fix releasing of sub-CRQ IRQs in interrupt context Revert "ibmvnic: Fix releasing of sub-CRQ IRQs in interrupt context" arch/powerpc: Update parameters for csum_tcpudp_magic & csum_tcpudp_nofold net/mlx4_en: Save slave ethtool stats command net/mlx4_en: Fix potential deadlock in port statistics flow net/mlx4: Fix firmware command timeout during interrupt test net/mlx4_core: Do not access comm channel if it has not yet been initialized net/mlx4_en: Fix panic during reboot net/mlx4_en: Process all completions in RX rings after port goes up net/mlx4_en: Resolve dividing by zero in 32-bit system net/mlx4_core: Change the default value of enable_qos net/mlx4_core: Avoid setting ports to auto when only one port type is supported net/mlx4_core: Fix the resource-type enum in res tracker to conform to FW spec ...
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/bcast.c14
-rw-r--r--net/tipc/bcast.h3
-rw-r--r--net/tipc/link.c2
-rw-r--r--net/tipc/msg.h17
-rw-r--r--net/tipc/name_distr.c1
-rw-r--r--net/tipc/node.c2
6 files changed, 33 insertions, 6 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 753f774cb46f..aa1babbea385 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -247,11 +247,17 @@ int tipc_bcast_rcv(struct net *net, struct tipc_link *l, struct sk_buff *skb)
247 * 247 *
248 * RCU is locked, no other locks set 248 * RCU is locked, no other locks set
249 */ 249 */
250void tipc_bcast_ack_rcv(struct net *net, struct tipc_link *l, u32 acked) 250void tipc_bcast_ack_rcv(struct net *net, struct tipc_link *l,
251 struct tipc_msg *hdr)
251{ 252{
252 struct sk_buff_head *inputq = &tipc_bc_base(net)->inputq; 253 struct sk_buff_head *inputq = &tipc_bc_base(net)->inputq;
254 u16 acked = msg_bcast_ack(hdr);
253 struct sk_buff_head xmitq; 255 struct sk_buff_head xmitq;
254 256
257 /* Ignore bc acks sent by peer before bcast synch point was received */
258 if (msg_bc_ack_invalid(hdr))
259 return;
260
255 __skb_queue_head_init(&xmitq); 261 __skb_queue_head_init(&xmitq);
256 262
257 tipc_bcast_lock(net); 263 tipc_bcast_lock(net);
@@ -279,11 +285,11 @@ int tipc_bcast_sync_rcv(struct net *net, struct tipc_link *l,
279 __skb_queue_head_init(&xmitq); 285 __skb_queue_head_init(&xmitq);
280 286
281 tipc_bcast_lock(net); 287 tipc_bcast_lock(net);
282 if (msg_type(hdr) == STATE_MSG) { 288 if (msg_type(hdr) != STATE_MSG) {
289 tipc_link_bc_init_rcv(l, hdr);
290 } else if (!msg_bc_ack_invalid(hdr)) {
283 tipc_link_bc_ack_rcv(l, msg_bcast_ack(hdr), &xmitq); 291 tipc_link_bc_ack_rcv(l, msg_bcast_ack(hdr), &xmitq);
284 rc = tipc_link_bc_sync_rcv(l, hdr, &xmitq); 292 rc = tipc_link_bc_sync_rcv(l, hdr, &xmitq);
285 } else {
286 tipc_link_bc_init_rcv(l, hdr);
287 } 293 }
288 tipc_bcast_unlock(net); 294 tipc_bcast_unlock(net);
289 295
diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h
index 5ffe34472ccd..855d53c64ab3 100644
--- a/net/tipc/bcast.h
+++ b/net/tipc/bcast.h
@@ -55,7 +55,8 @@ void tipc_bcast_dec_bearer_dst_cnt(struct net *net, int bearer_id);
55int tipc_bcast_get_mtu(struct net *net); 55int tipc_bcast_get_mtu(struct net *net);
56int tipc_bcast_xmit(struct net *net, struct sk_buff_head *list); 56int tipc_bcast_xmit(struct net *net, struct sk_buff_head *list);
57int tipc_bcast_rcv(struct net *net, struct tipc_link *l, struct sk_buff *skb); 57int tipc_bcast_rcv(struct net *net, struct tipc_link *l, struct sk_buff *skb);
58void tipc_bcast_ack_rcv(struct net *net, struct tipc_link *l, u32 acked); 58void tipc_bcast_ack_rcv(struct net *net, struct tipc_link *l,
59 struct tipc_msg *hdr);
59int tipc_bcast_sync_rcv(struct net *net, struct tipc_link *l, 60int tipc_bcast_sync_rcv(struct net *net, struct tipc_link *l,
60 struct tipc_msg *hdr); 61 struct tipc_msg *hdr);
61int tipc_nl_add_bc_link(struct net *net, struct tipc_nl_msg *msg); 62int tipc_nl_add_bc_link(struct net *net, struct tipc_nl_msg *msg);
diff --git a/net/tipc/link.c b/net/tipc/link.c
index b36e16cdc945..1055164c6232 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1312,6 +1312,7 @@ static void tipc_link_build_proto_msg(struct tipc_link *l, int mtyp, bool probe,
1312 msg_set_next_sent(hdr, l->snd_nxt); 1312 msg_set_next_sent(hdr, l->snd_nxt);
1313 msg_set_ack(hdr, l->rcv_nxt - 1); 1313 msg_set_ack(hdr, l->rcv_nxt - 1);
1314 msg_set_bcast_ack(hdr, bcl->rcv_nxt - 1); 1314 msg_set_bcast_ack(hdr, bcl->rcv_nxt - 1);
1315 msg_set_bc_ack_invalid(hdr, !node_up);
1315 msg_set_last_bcast(hdr, l->bc_sndlink->snd_nxt - 1); 1316 msg_set_last_bcast(hdr, l->bc_sndlink->snd_nxt - 1);
1316 msg_set_link_tolerance(hdr, tolerance); 1317 msg_set_link_tolerance(hdr, tolerance);
1317 msg_set_linkprio(hdr, priority); 1318 msg_set_linkprio(hdr, priority);
@@ -1574,6 +1575,7 @@ static void tipc_link_build_bc_init_msg(struct tipc_link *l,
1574 __skb_queue_head_init(&list); 1575 __skb_queue_head_init(&list);
1575 if (!tipc_link_build_bc_proto_msg(l->bc_rcvlink, false, 0, &list)) 1576 if (!tipc_link_build_bc_proto_msg(l->bc_rcvlink, false, 0, &list))
1576 return; 1577 return;
1578 msg_set_bc_ack_invalid(buf_msg(skb_peek(&list)), true);
1577 tipc_link_xmit(l, &list, xmitq); 1579 tipc_link_xmit(l, &list, xmitq);
1578} 1580}
1579 1581
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index c3832cdf2278..50a739860d37 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -714,6 +714,23 @@ static inline void msg_set_peer_stopping(struct tipc_msg *m, u32 s)
714 msg_set_bits(m, 5, 13, 0x1, s); 714 msg_set_bits(m, 5, 13, 0x1, s);
715} 715}
716 716
717static inline bool msg_bc_ack_invalid(struct tipc_msg *m)
718{
719 switch (msg_user(m)) {
720 case BCAST_PROTOCOL:
721 case NAME_DISTRIBUTOR:
722 case LINK_PROTOCOL:
723 return msg_bits(m, 5, 14, 0x1);
724 default:
725 return false;
726 }
727}
728
729static inline void msg_set_bc_ack_invalid(struct tipc_msg *m, bool invalid)
730{
731 msg_set_bits(m, 5, 14, 0x1, invalid);
732}
733
717static inline char *msg_media_addr(struct tipc_msg *m) 734static inline char *msg_media_addr(struct tipc_msg *m)
718{ 735{
719 return (char *)&m->hdr[TIPC_MEDIA_INFO_OFFSET]; 736 return (char *)&m->hdr[TIPC_MEDIA_INFO_OFFSET];
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index a04fe9be1c60..c1cfd92de17a 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -156,6 +156,7 @@ static void named_distribute(struct net *net, struct sk_buff_head *list,
156 pr_warn("Bulk publication failure\n"); 156 pr_warn("Bulk publication failure\n");
157 return; 157 return;
158 } 158 }
159 msg_set_bc_ack_invalid(buf_msg(skb), true);
159 item = (struct distr_item *)msg_data(buf_msg(skb)); 160 item = (struct distr_item *)msg_data(buf_msg(skb));
160 } 161 }
161 162
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 7ef14e2d2356..9d2f4c2b08ab 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -1535,7 +1535,7 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b)
1535 if (unlikely(usr == LINK_PROTOCOL)) 1535 if (unlikely(usr == LINK_PROTOCOL))
1536 tipc_node_bc_sync_rcv(n, hdr, bearer_id, &xmitq); 1536 tipc_node_bc_sync_rcv(n, hdr, bearer_id, &xmitq);
1537 else if (unlikely(tipc_link_acked(n->bc_entry.link) != bc_ack)) 1537 else if (unlikely(tipc_link_acked(n->bc_entry.link) != bc_ack))
1538 tipc_bcast_ack_rcv(net, n->bc_entry.link, bc_ack); 1538 tipc_bcast_ack_rcv(net, n->bc_entry.link, hdr);
1539 1539
1540 /* Receive packet directly if conditions permit */ 1540 /* Receive packet directly if conditions permit */
1541 tipc_node_read_lock(n); 1541 tipc_node_read_lock(n);