aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-08 15:41:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-08 15:41:23 -0400
commitce7613db2d8d4d5af2587ab5d7090055c4562201 (patch)
treebc1037a83581e27e9a3f9d52b8e073a0a803a964 /net/sctp
parent0afccc4ccecf8436b8e59369b384f6d0a56c90d1 (diff)
parent52c35befb69b005c3fc5afdaae3a5717ad013411 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull more networking updates from David Miller: 1) If a VXLAN interface is created with no groups, we can crash on reception of packets. Fix from Mike Rapoport. 2) Missing includes in CPTS driver, from Alexei Starovoitov. 3) Fix string validations in isdnloop driver, from YOSHIFUJI Hideaki and Dan Carpenter. 4) Missing irq.h include in bnxw2x, enic, and qlcnic drivers. From Josh Boyer. 5) AF_PACKET transmit doesn't statistically count TX drops, from Daniel Borkmann. 6) Byte-Queue-Limit enabled drivers aren't handled properly in AF_PACKET transmit path, also from Daniel Borkmann. Same problem exists in pktgen, and Daniel fixed it there too. 7) Fix resource leaks in driver probe error paths of new sxgbe driver, from Francois Romieu. 8) Truesize of SKBs can gradually get more and more corrupted in NAPI packet recycling path, fix from Eric Dumazet. 9) Fix uniprocessor netfilter build, from Florian Westphal. In the longer term we should perhaps try to find a way for ARRAY_SIZE() to work even with zero sized array elements. 10) Fix crash in netfilter conntrack extensions due to mis-estimation of required extension space. From Andrey Vagin. 11) Since we commit table rule updates before trying to copy the counters back to userspace (it's the last action we perform), we really can't signal the user copy with an error as we are beyond the point from which we can unwind everything. This causes all kinds of use after free crashes and other mysterious behavior. From Thomas Graf. 12) Restore previous behvaior of div/mod by zero in BPF filter processing. From Daniel Borkmann. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (38 commits) net: sctp: wake up all assocs if sndbuf policy is per socket isdnloop: several buffer overflows netdev: remove potentially harmful checks pktgen: fix xmit test for BQL enabled devices net/at91_ether: avoid NULL pointer dereference tipc: Let tipc_release() return 0 at86rf230: fix MAX_CSMA_RETRIES parameter mac802154: fix duplicate #include headers sxgbe: fix duplicate #include headers net: filter: be more defensive on div/mod by X==0 netfilter: Can't fail and free after table replacement xen-netback: Trivial format string fix net: bcmgenet: Remove unnecessary version.h inclusion net: smc911x: Remove unused local variable bonding: Inactive slaves should keep inactive flag's value netfilter: nf_tables: fix wrong format in request_module() netfilter: nf_tables: set names cannot be larger than 15 bytes netfilter: nf_conntrack: reserve two bytes for nf_ct_ext->len netfilter: Add {ipt,ip6t}_osf aliases for xt_osf netfilter: x_tables: allow to use cgroup match for LOCAL_IN nf hooks ...
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/socket.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 981aaf8b6ace..5f83a6a2fa67 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -6593,6 +6593,40 @@ static void __sctp_write_space(struct sctp_association *asoc)
6593 } 6593 }
6594} 6594}
6595 6595
6596static void sctp_wake_up_waiters(struct sock *sk,
6597 struct sctp_association *asoc)
6598{
6599 struct sctp_association *tmp = asoc;
6600
6601 /* We do accounting for the sndbuf space per association,
6602 * so we only need to wake our own association.
6603 */
6604 if (asoc->ep->sndbuf_policy)
6605 return __sctp_write_space(asoc);
6606
6607 /* Accounting for the sndbuf space is per socket, so we
6608 * need to wake up others, try to be fair and in case of
6609 * other associations, let them have a go first instead
6610 * of just doing a sctp_write_space() call.
6611 *
6612 * Note that we reach sctp_wake_up_waiters() only when
6613 * associations free up queued chunks, thus we are under
6614 * lock and the list of associations on a socket is
6615 * guaranteed not to change.
6616 */
6617 for (tmp = list_next_entry(tmp, asocs); 1;
6618 tmp = list_next_entry(tmp, asocs)) {
6619 /* Manually skip the head element. */
6620 if (&tmp->asocs == &((sctp_sk(sk))->ep->asocs))
6621 continue;
6622 /* Wake up association. */
6623 __sctp_write_space(tmp);
6624 /* We've reached the end. */
6625 if (tmp == asoc)
6626 break;
6627 }
6628}
6629
6596/* Do accounting for the sndbuf space. 6630/* Do accounting for the sndbuf space.
6597 * Decrement the used sndbuf space of the corresponding association by the 6631 * Decrement the used sndbuf space of the corresponding association by the
6598 * data size which was just transmitted(freed). 6632 * data size which was just transmitted(freed).
@@ -6620,7 +6654,7 @@ static void sctp_wfree(struct sk_buff *skb)
6620 sk_mem_uncharge(sk, skb->truesize); 6654 sk_mem_uncharge(sk, skb->truesize);
6621 6655
6622 sock_wfree(skb); 6656 sock_wfree(skb);
6623 __sctp_write_space(asoc); 6657 sctp_wake_up_waiters(sk, asoc);
6624 6658
6625 sctp_association_put(asoc); 6659 sctp_association_put(asoc);
6626} 6660}