diff options
| author | David S. Miller <davem@davemloft.net> | 2018-02-19 18:46:11 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-02-19 18:46:11 -0500 |
| commit | f5c0c6f4299f870f074235fbf552ecf957fc249c (patch) | |
| tree | 6b46b9c0b271185b6f98fab350c3891042e729b1 /net | |
| parent | 26736a08ee0fb89a4f09bfb2c9f0805028ff63aa (diff) | |
| parent | 79c0ef3e85c015b0921a8fd5dd539d1480e9cd6c (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net')
| -rw-r--r-- | net/9p/trans_virtio.c | 3 | ||||
| -rw-r--r-- | net/bridge/br_sysfs_if.c | 3 | ||||
| -rw-r--r-- | net/core/dev.c | 11 | ||||
| -rw-r--r-- | net/decnet/af_decnet.c | 62 | ||||
| -rw-r--r-- | net/ipv4/fib_semantics.c | 5 | ||||
| -rw-r--r-- | net/ipv4/tcp_output.c | 25 | ||||
| -rw-r--r-- | net/ipv4/udp.c | 5 | ||||
| -rw-r--r-- | net/ipv6/ip6_checksum.c | 5 | ||||
| -rw-r--r-- | net/nfc/llcp_commands.c | 4 | ||||
| -rw-r--r-- | net/nfc/netlink.c | 3 | ||||
| -rw-r--r-- | net/rds/connection.c | 2 | ||||
| -rw-r--r-- | net/rxrpc/recvmsg.c | 5 | ||||
| -rw-r--r-- | net/sched/cls_api.c | 26 | ||||
| -rw-r--r-- | net/sched/cls_u32.c | 24 | ||||
| -rw-r--r-- | net/sctp/debug.c | 6 | ||||
| -rw-r--r-- | net/sctp/input.c | 5 | ||||
| -rw-r--r-- | net/sctp/stream.c | 2 | ||||
| -rw-r--r-- | net/sctp/stream_interleave.c | 16 | ||||
| -rw-r--r-- | net/tipc/bearer.c | 82 | ||||
| -rw-r--r-- | net/tipc/bearer.h | 4 | ||||
| -rw-r--r-- | net/tipc/net.c | 15 | ||||
| -rw-r--r-- | net/tipc/net.h | 1 | ||||
| -rw-r--r-- | net/tipc/netlink_compat.c | 43 | ||||
| -rw-r--r-- | net/tls/tls_main.c | 7 | ||||
| -rw-r--r-- | net/unix/af_unix.c | 2 |
25 files changed, 240 insertions, 126 deletions
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index f3a4efcf1456..3aa5a93ad107 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c | |||
| @@ -160,7 +160,8 @@ static void req_done(struct virtqueue *vq) | |||
| 160 | spin_unlock_irqrestore(&chan->lock, flags); | 160 | spin_unlock_irqrestore(&chan->lock, flags); |
| 161 | /* Wakeup if anyone waiting for VirtIO ring space. */ | 161 | /* Wakeup if anyone waiting for VirtIO ring space. */ |
| 162 | wake_up(chan->vc_wq); | 162 | wake_up(chan->vc_wq); |
| 163 | p9_client_cb(chan->client, req, REQ_STATUS_RCVD); | 163 | if (len) |
| 164 | p9_client_cb(chan->client, req, REQ_STATUS_RCVD); | ||
| 164 | } | 165 | } |
| 165 | } | 166 | } |
| 166 | 167 | ||
diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c index 0254c35b2bf0..126a8ea73c96 100644 --- a/net/bridge/br_sysfs_if.c +++ b/net/bridge/br_sysfs_if.c | |||
| @@ -255,6 +255,9 @@ static ssize_t brport_show(struct kobject *kobj, | |||
| 255 | struct brport_attribute *brport_attr = to_brport_attr(attr); | 255 | struct brport_attribute *brport_attr = to_brport_attr(attr); |
| 256 | struct net_bridge_port *p = to_brport(kobj); | 256 | struct net_bridge_port *p = to_brport(kobj); |
| 257 | 257 | ||
| 258 | if (!brport_attr->show) | ||
| 259 | return -EINVAL; | ||
| 260 | |||
| 258 | return brport_attr->show(p, buf); | 261 | return brport_attr->show(p, buf); |
| 259 | } | 262 | } |
| 260 | 263 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index 4bd4ad7ffda4..5bdcc5a161fe 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -2382,8 +2382,11 @@ EXPORT_SYMBOL(netdev_set_num_tc); | |||
| 2382 | */ | 2382 | */ |
| 2383 | int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq) | 2383 | int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq) |
| 2384 | { | 2384 | { |
| 2385 | bool disabling; | ||
| 2385 | int rc; | 2386 | int rc; |
| 2386 | 2387 | ||
| 2388 | disabling = txq < dev->real_num_tx_queues; | ||
| 2389 | |||
| 2387 | if (txq < 1 || txq > dev->num_tx_queues) | 2390 | if (txq < 1 || txq > dev->num_tx_queues) |
| 2388 | return -EINVAL; | 2391 | return -EINVAL; |
| 2389 | 2392 | ||
| @@ -2399,15 +2402,19 @@ int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq) | |||
| 2399 | if (dev->num_tc) | 2402 | if (dev->num_tc) |
| 2400 | netif_setup_tc(dev, txq); | 2403 | netif_setup_tc(dev, txq); |
| 2401 | 2404 | ||
| 2402 | if (txq < dev->real_num_tx_queues) { | 2405 | dev->real_num_tx_queues = txq; |
| 2406 | |||
| 2407 | if (disabling) { | ||
| 2408 | synchronize_net(); | ||
| 2403 | qdisc_reset_all_tx_gt(dev, txq); | 2409 | qdisc_reset_all_tx_gt(dev, txq); |
| 2404 | #ifdef CONFIG_XPS | 2410 | #ifdef CONFIG_XPS |
| 2405 | netif_reset_xps_queues_gt(dev, txq); | 2411 | netif_reset_xps_queues_gt(dev, txq); |
| 2406 | #endif | 2412 | #endif |
| 2407 | } | 2413 | } |
| 2414 | } else { | ||
| 2415 | dev->real_num_tx_queues = txq; | ||
| 2408 | } | 2416 | } |
| 2409 | 2417 | ||
| 2410 | dev->real_num_tx_queues = txq; | ||
| 2411 | return 0; | 2418 | return 0; |
| 2412 | } | 2419 | } |
| 2413 | EXPORT_SYMBOL(netif_set_real_num_tx_queues); | 2420 | EXPORT_SYMBOL(netif_set_real_num_tx_queues); |
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index 45cb5bea884b..2ee8306c23e3 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c | |||
| @@ -1336,6 +1336,12 @@ static int dn_setsockopt(struct socket *sock, int level, int optname, char __use | |||
| 1336 | lock_sock(sk); | 1336 | lock_sock(sk); |
| 1337 | err = __dn_setsockopt(sock, level, optname, optval, optlen, 0); | 1337 | err = __dn_setsockopt(sock, level, optname, optval, optlen, 0); |
| 1338 | release_sock(sk); | 1338 | release_sock(sk); |
| 1339 | #ifdef CONFIG_NETFILTER | ||
| 1340 | /* we need to exclude all possible ENOPROTOOPTs except default case */ | ||
| 1341 | if (err == -ENOPROTOOPT && optname != DSO_LINKINFO && | ||
| 1342 | optname != DSO_STREAM && optname != DSO_SEQPACKET) | ||
| 1343 | err = nf_setsockopt(sk, PF_DECnet, optname, optval, optlen); | ||
| 1344 | #endif | ||
| 1339 | 1345 | ||
| 1340 | return err; | 1346 | return err; |
| 1341 | } | 1347 | } |
| @@ -1443,15 +1449,6 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us | |||
| 1443 | dn_nsp_send_disc(sk, 0x38, 0, sk->sk_allocation); | 1449 | dn_nsp_send_disc(sk, 0x38, 0, sk->sk_allocation); |
| 1444 | break; | 1450 | break; |
| 1445 | 1451 | ||
| 1446 | default: | ||
| 1447 | #ifdef CONFIG_NETFILTER | ||
| 1448 | return nf_setsockopt(sk, PF_DECnet, optname, optval, optlen); | ||
| 1449 | #endif | ||
| 1450 | case DSO_LINKINFO: | ||
| 1451 | case DSO_STREAM: | ||
| 1452 | case DSO_SEQPACKET: | ||
| 1453 | return -ENOPROTOOPT; | ||
| 1454 | |||
| 1455 | case DSO_MAXWINDOW: | 1452 | case DSO_MAXWINDOW: |
| 1456 | if (optlen != sizeof(unsigned long)) | 1453 | if (optlen != sizeof(unsigned long)) |
| 1457 | return -EINVAL; | 1454 | return -EINVAL; |
| @@ -1499,6 +1496,12 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us | |||
| 1499 | return -EINVAL; | 1496 | return -EINVAL; |
| 1500 | scp->info_loc = u.info; | 1497 | scp->info_loc = u.info; |
| 1501 | break; | 1498 | break; |
| 1499 | |||
| 1500 | case DSO_LINKINFO: | ||
| 1501 | case DSO_STREAM: | ||
| 1502 | case DSO_SEQPACKET: | ||
| 1503 | default: | ||
| 1504 | return -ENOPROTOOPT; | ||
| 1502 | } | 1505 | } |
| 1503 | 1506 | ||
| 1504 | return 0; | 1507 | return 0; |
| @@ -1512,6 +1515,20 @@ static int dn_getsockopt(struct socket *sock, int level, int optname, char __use | |||
| 1512 | lock_sock(sk); | 1515 | lock_sock(sk); |
| 1513 | err = __dn_getsockopt(sock, level, optname, optval, optlen, 0); | 1516 | err = __dn_getsockopt(sock, level, optname, optval, optlen, 0); |
| 1514 | release_sock(sk); | 1517 | release_sock(sk); |
| 1518 | #ifdef CONFIG_NETFILTER | ||
| 1519 | if (err == -ENOPROTOOPT && optname != DSO_STREAM && | ||
| 1520 | optname != DSO_SEQPACKET && optname != DSO_CONACCEPT && | ||
| 1521 | optname != DSO_CONREJECT) { | ||
| 1522 | int len; | ||
| 1523 | |||
| 1524 | if (get_user(len, optlen)) | ||
| 1525 | return -EFAULT; | ||
| 1526 | |||
| 1527 | err = nf_getsockopt(sk, PF_DECnet, optname, optval, &len); | ||
| 1528 | if (err >= 0) | ||
| 1529 | err = put_user(len, optlen); | ||
| 1530 | } | ||
| 1531 | #endif | ||
| 1515 | 1532 | ||
| 1516 | return err; | 1533 | return err; |
| 1517 | } | 1534 | } |
| @@ -1577,26 +1594,6 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us | |||
| 1577 | r_data = &link; | 1594 | r_data = &link; |
| 1578 | break; | 1595 | break; |
| 1579 | 1596 | ||
| 1580 | default: | ||
| 1581 | #ifdef CONFIG_NETFILTER | ||
| 1582 | { | ||
| 1583 | int ret, len; | ||
| 1584 | |||
| 1585 | if (get_user(len, optlen)) | ||
| 1586 | return -EFAULT; | ||
| 1587 | |||
| 1588 | ret = nf_getsockopt(sk, PF_DECnet, optname, optval, &len); | ||
| 1589 | if (ret >= 0) | ||
| 1590 | ret = put_user(len, optlen); | ||
| 1591 | return ret; | ||
| 1592 | } | ||
| 1593 | #endif | ||
| 1594 | case DSO_STREAM: | ||
| 1595 | case DSO_SEQPACKET: | ||
| 1596 | case DSO_CONACCEPT: | ||
| 1597 | case DSO_CONREJECT: | ||
| 1598 | return -ENOPROTOOPT; | ||
| 1599 | |||
| 1600 | case DSO_MAXWINDOW: | 1597 | case DSO_MAXWINDOW: |
| 1601 | if (r_len > sizeof(unsigned long)) | 1598 | if (r_len > sizeof(unsigned long)) |
| 1602 | r_len = sizeof(unsigned long); | 1599 | r_len = sizeof(unsigned long); |
| @@ -1628,6 +1625,13 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us | |||
| 1628 | r_len = sizeof(unsigned char); | 1625 | r_len = sizeof(unsigned char); |
| 1629 | r_data = &scp->info_rem; | 1626 | r_data = &scp->info_rem; |
| 1630 | break; | 1627 | break; |
| 1628 | |||
| 1629 | case DSO_STREAM: | ||
| 1630 | case DSO_SEQPACKET: | ||
| 1631 | case DSO_CONACCEPT: | ||
| 1632 | case DSO_CONREJECT: | ||
| 1633 | default: | ||
| 1634 | return -ENOPROTOOPT; | ||
| 1631 | } | 1635 | } |
| 1632 | 1636 | ||
| 1633 | if (r_data) { | 1637 | if (r_data) { |
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 2b883b58354f..cd46d7666598 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
| @@ -646,6 +646,11 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi, | |||
| 646 | fi->fib_nh, cfg, extack)) | 646 | fi->fib_nh, cfg, extack)) |
| 647 | return 1; | 647 | return 1; |
| 648 | } | 648 | } |
| 649 | #ifdef CONFIG_IP_ROUTE_CLASSID | ||
| 650 | if (cfg->fc_flow && | ||
| 651 | cfg->fc_flow != fi->fib_nh->nh_tclassid) | ||
| 652 | return 1; | ||
| 653 | #endif | ||
| 649 | if ((!cfg->fc_oif || cfg->fc_oif == fi->fib_nh->nh_oif) && | 654 | if ((!cfg->fc_oif || cfg->fc_oif == fi->fib_nh->nh_oif) && |
| 650 | (!cfg->fc_gw || cfg->fc_gw == fi->fib_nh->nh_gw)) | 655 | (!cfg->fc_gw || cfg->fc_gw == fi->fib_nh->nh_gw)) |
| 651 | return 0; | 656 | return 0; |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index e9f985e42405..b2bca373f8be 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -2027,6 +2027,24 @@ static inline void tcp_mtu_check_reprobe(struct sock *sk) | |||
| 2027 | } | 2027 | } |
| 2028 | } | 2028 | } |
| 2029 | 2029 | ||
| 2030 | static bool tcp_can_coalesce_send_queue_head(struct sock *sk, int len) | ||
| 2031 | { | ||
| 2032 | struct sk_buff *skb, *next; | ||
| 2033 | |||
| 2034 | skb = tcp_send_head(sk); | ||
| 2035 | tcp_for_write_queue_from_safe(skb, next, sk) { | ||
| 2036 | if (len <= skb->len) | ||
| 2037 | break; | ||
| 2038 | |||
| 2039 | if (unlikely(TCP_SKB_CB(skb)->eor)) | ||
| 2040 | return false; | ||
| 2041 | |||
| 2042 | len -= skb->len; | ||
| 2043 | } | ||
| 2044 | |||
| 2045 | return true; | ||
| 2046 | } | ||
| 2047 | |||
| 2030 | /* Create a new MTU probe if we are ready. | 2048 | /* Create a new MTU probe if we are ready. |
| 2031 | * MTU probe is regularly attempting to increase the path MTU by | 2049 | * MTU probe is regularly attempting to increase the path MTU by |
| 2032 | * deliberately sending larger packets. This discovers routing | 2050 | * deliberately sending larger packets. This discovers routing |
| @@ -2099,6 +2117,9 @@ static int tcp_mtu_probe(struct sock *sk) | |||
| 2099 | return 0; | 2117 | return 0; |
| 2100 | } | 2118 | } |
| 2101 | 2119 | ||
| 2120 | if (!tcp_can_coalesce_send_queue_head(sk, probe_size)) | ||
| 2121 | return -1; | ||
| 2122 | |||
| 2102 | /* We're allowed to probe. Build it now. */ | 2123 | /* We're allowed to probe. Build it now. */ |
| 2103 | nskb = sk_stream_alloc_skb(sk, probe_size, GFP_ATOMIC, false); | 2124 | nskb = sk_stream_alloc_skb(sk, probe_size, GFP_ATOMIC, false); |
| 2104 | if (!nskb) | 2125 | if (!nskb) |
| @@ -2134,6 +2155,10 @@ static int tcp_mtu_probe(struct sock *sk) | |||
| 2134 | /* We've eaten all the data from this skb. | 2155 | /* We've eaten all the data from this skb. |
| 2135 | * Throw it away. */ | 2156 | * Throw it away. */ |
| 2136 | TCP_SKB_CB(nskb)->tcp_flags |= TCP_SKB_CB(skb)->tcp_flags; | 2157 | TCP_SKB_CB(nskb)->tcp_flags |= TCP_SKB_CB(skb)->tcp_flags; |
| 2158 | /* If this is the last SKB we copy and eor is set | ||
| 2159 | * we need to propagate it to the new skb. | ||
| 2160 | */ | ||
| 2161 | TCP_SKB_CB(nskb)->eor = TCP_SKB_CB(skb)->eor; | ||
| 2137 | tcp_unlink_write_queue(skb, sk); | 2162 | tcp_unlink_write_queue(skb, sk); |
| 2138 | sk_wmem_free_skb(sk, skb); | 2163 | sk_wmem_free_skb(sk, skb); |
| 2139 | } else { | 2164 | } else { |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index ac5fac0e59b1..3013404d0935 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
| @@ -2024,6 +2024,11 @@ static inline int udp4_csum_init(struct sk_buff *skb, struct udphdr *uh, | |||
| 2024 | err = udplite_checksum_init(skb, uh); | 2024 | err = udplite_checksum_init(skb, uh); |
| 2025 | if (err) | 2025 | if (err) |
| 2026 | return err; | 2026 | return err; |
| 2027 | |||
| 2028 | if (UDP_SKB_CB(skb)->partial_cov) { | ||
| 2029 | skb->csum = inet_compute_pseudo(skb, proto); | ||
| 2030 | return 0; | ||
| 2031 | } | ||
| 2027 | } | 2032 | } |
| 2028 | 2033 | ||
| 2029 | /* Note, we are only interested in != 0 or == 0, thus the | 2034 | /* Note, we are only interested in != 0 or == 0, thus the |
diff --git a/net/ipv6/ip6_checksum.c b/net/ipv6/ip6_checksum.c index ec43d18b5ff9..547515e8450a 100644 --- a/net/ipv6/ip6_checksum.c +++ b/net/ipv6/ip6_checksum.c | |||
| @@ -73,6 +73,11 @@ int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto) | |||
| 73 | err = udplite_checksum_init(skb, uh); | 73 | err = udplite_checksum_init(skb, uh); |
| 74 | if (err) | 74 | if (err) |
| 75 | return err; | 75 | return err; |
| 76 | |||
| 77 | if (UDP_SKB_CB(skb)->partial_cov) { | ||
| 78 | skb->csum = ip6_compute_pseudo(skb, proto); | ||
| 79 | return 0; | ||
| 80 | } | ||
| 76 | } | 81 | } |
| 77 | 82 | ||
| 78 | /* To support RFC 6936 (allow zero checksum in UDP/IPV6 for tunnels) | 83 | /* To support RFC 6936 (allow zero checksum in UDP/IPV6 for tunnels) |
diff --git a/net/nfc/llcp_commands.c b/net/nfc/llcp_commands.c index 367d8c027101..2ceefa183cee 100644 --- a/net/nfc/llcp_commands.c +++ b/net/nfc/llcp_commands.c | |||
| @@ -149,6 +149,10 @@ struct nfc_llcp_sdp_tlv *nfc_llcp_build_sdreq_tlv(u8 tid, char *uri, | |||
| 149 | 149 | ||
| 150 | pr_debug("uri: %s, len: %zu\n", uri, uri_len); | 150 | pr_debug("uri: %s, len: %zu\n", uri, uri_len); |
| 151 | 151 | ||
| 152 | /* sdreq->tlv_len is u8, takes uri_len, + 3 for header, + 1 for NULL */ | ||
| 153 | if (WARN_ON_ONCE(uri_len > U8_MAX - 4)) | ||
| 154 | return NULL; | ||
| 155 | |||
| 152 | sdreq = kzalloc(sizeof(struct nfc_llcp_sdp_tlv), GFP_KERNEL); | 156 | sdreq = kzalloc(sizeof(struct nfc_llcp_sdp_tlv), GFP_KERNEL); |
| 153 | if (sdreq == NULL) | 157 | if (sdreq == NULL) |
| 154 | return NULL; | 158 | return NULL; |
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c index c0b83dc9d993..f018eafc2a0d 100644 --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c | |||
| @@ -61,7 +61,8 @@ static const struct nla_policy nfc_genl_policy[NFC_ATTR_MAX + 1] = { | |||
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| 63 | static const struct nla_policy nfc_sdp_genl_policy[NFC_SDP_ATTR_MAX + 1] = { | 63 | static const struct nla_policy nfc_sdp_genl_policy[NFC_SDP_ATTR_MAX + 1] = { |
| 64 | [NFC_SDP_ATTR_URI] = { .type = NLA_STRING }, | 64 | [NFC_SDP_ATTR_URI] = { .type = NLA_STRING, |
| 65 | .len = U8_MAX - 4 }, | ||
| 65 | [NFC_SDP_ATTR_SAP] = { .type = NLA_U8 }, | 66 | [NFC_SDP_ATTR_SAP] = { .type = NLA_U8 }, |
| 66 | }; | 67 | }; |
| 67 | 68 | ||
diff --git a/net/rds/connection.c b/net/rds/connection.c index 94e190febfdd..2da3176bf792 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c | |||
| @@ -224,7 +224,7 @@ static struct rds_connection *__rds_conn_create(struct net *net, | |||
| 224 | if (rds_destroy_pending(conn)) | 224 | if (rds_destroy_pending(conn)) |
| 225 | ret = -ENETDOWN; | 225 | ret = -ENETDOWN; |
| 226 | else | 226 | else |
| 227 | ret = trans->conn_alloc(conn, gfp); | 227 | ret = trans->conn_alloc(conn, GFP_ATOMIC); |
| 228 | if (ret) { | 228 | if (ret) { |
| 229 | rcu_read_unlock(); | 229 | rcu_read_unlock(); |
| 230 | kfree(conn->c_path); | 230 | kfree(conn->c_path); |
diff --git a/net/rxrpc/recvmsg.c b/net/rxrpc/recvmsg.c index cc21e8db25b0..9d45d8b56744 100644 --- a/net/rxrpc/recvmsg.c +++ b/net/rxrpc/recvmsg.c | |||
| @@ -517,9 +517,10 @@ try_again: | |||
| 517 | ret = put_cmsg(msg, SOL_RXRPC, RXRPC_USER_CALL_ID, | 517 | ret = put_cmsg(msg, SOL_RXRPC, RXRPC_USER_CALL_ID, |
| 518 | sizeof(unsigned int), &id32); | 518 | sizeof(unsigned int), &id32); |
| 519 | } else { | 519 | } else { |
| 520 | unsigned long idl = call->user_call_ID; | ||
| 521 | |||
| 520 | ret = put_cmsg(msg, SOL_RXRPC, RXRPC_USER_CALL_ID, | 522 | ret = put_cmsg(msg, SOL_RXRPC, RXRPC_USER_CALL_ID, |
| 521 | sizeof(unsigned long), | 523 | sizeof(unsigned long), &idl); |
| 522 | &call->user_call_ID); | ||
| 523 | } | 524 | } |
| 524 | if (ret < 0) | 525 | if (ret < 0) |
| 525 | goto error_unlock_call; | 526 | goto error_unlock_call; |
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index f21610c5da1a..3e14d38e5d42 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
| @@ -376,17 +376,12 @@ struct tcf_net { | |||
| 376 | static unsigned int tcf_net_id; | 376 | static unsigned int tcf_net_id; |
| 377 | 377 | ||
| 378 | static int tcf_block_insert(struct tcf_block *block, struct net *net, | 378 | static int tcf_block_insert(struct tcf_block *block, struct net *net, |
| 379 | u32 block_index, struct netlink_ext_ack *extack) | 379 | struct netlink_ext_ack *extack) |
| 380 | { | 380 | { |
| 381 | struct tcf_net *tn = net_generic(net, tcf_net_id); | 381 | struct tcf_net *tn = net_generic(net, tcf_net_id); |
| 382 | int err; | ||
| 383 | 382 | ||
| 384 | err = idr_alloc_u32(&tn->idr, block, &block_index, block_index, | 383 | return idr_alloc_u32(&tn->idr, block, &block->index, block->index, |
| 385 | GFP_KERNEL); | 384 | GFP_KERNEL); |
| 386 | if (err) | ||
| 387 | return err; | ||
| 388 | block->index = block_index; | ||
| 389 | return 0; | ||
| 390 | } | 385 | } |
| 391 | 386 | ||
| 392 | static void tcf_block_remove(struct tcf_block *block, struct net *net) | 387 | static void tcf_block_remove(struct tcf_block *block, struct net *net) |
| @@ -397,6 +392,7 @@ static void tcf_block_remove(struct tcf_block *block, struct net *net) | |||
| 397 | } | 392 | } |
| 398 | 393 | ||
| 399 | static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q, | 394 | static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q, |
| 395 | u32 block_index, | ||
| 400 | struct netlink_ext_ack *extack) | 396 | struct netlink_ext_ack *extack) |
| 401 | { | 397 | { |
| 402 | struct tcf_block *block; | 398 | struct tcf_block *block; |
| @@ -419,10 +415,13 @@ static struct tcf_block *tcf_block_create(struct net *net, struct Qdisc *q, | |||
| 419 | err = -ENOMEM; | 415 | err = -ENOMEM; |
| 420 | goto err_chain_create; | 416 | goto err_chain_create; |
| 421 | } | 417 | } |
| 422 | block->net = qdisc_net(q); | ||
| 423 | block->refcnt = 1; | 418 | block->refcnt = 1; |
| 424 | block->net = net; | 419 | block->net = net; |
| 425 | block->q = q; | 420 | block->index = block_index; |
| 421 | |||
| 422 | /* Don't store q pointer for blocks which are shared */ | ||
| 423 | if (!tcf_block_shared(block)) | ||
| 424 | block->q = q; | ||
| 426 | return block; | 425 | return block; |
| 427 | 426 | ||
| 428 | err_chain_create: | 427 | err_chain_create: |
| @@ -518,13 +517,12 @@ int tcf_block_get_ext(struct tcf_block **p_block, struct Qdisc *q, | |||
| 518 | } | 517 | } |
| 519 | 518 | ||
| 520 | if (!block) { | 519 | if (!block) { |
| 521 | block = tcf_block_create(net, q, extack); | 520 | block = tcf_block_create(net, q, ei->block_index, extack); |
| 522 | if (IS_ERR(block)) | 521 | if (IS_ERR(block)) |
| 523 | return PTR_ERR(block); | 522 | return PTR_ERR(block); |
| 524 | created = true; | 523 | created = true; |
| 525 | if (ei->block_index) { | 524 | if (tcf_block_shared(block)) { |
| 526 | err = tcf_block_insert(block, net, | 525 | err = tcf_block_insert(block, net, extack); |
| 527 | ei->block_index, extack); | ||
| 528 | if (err) | 526 | if (err) |
| 529 | goto err_block_insert; | 527 | goto err_block_insert; |
| 530 | } | 528 | } |
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 6c7601a530e3..ed8b6a24b9e9 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
| @@ -96,7 +96,7 @@ struct tc_u_hnode { | |||
| 96 | 96 | ||
| 97 | struct tc_u_common { | 97 | struct tc_u_common { |
| 98 | struct tc_u_hnode __rcu *hlist; | 98 | struct tc_u_hnode __rcu *hlist; |
| 99 | struct tcf_block *block; | 99 | void *ptr; |
| 100 | int refcnt; | 100 | int refcnt; |
| 101 | struct idr handle_idr; | 101 | struct idr handle_idr; |
| 102 | struct hlist_node hnode; | 102 | struct hlist_node hnode; |
| @@ -330,9 +330,25 @@ static struct hlist_head *tc_u_common_hash; | |||
| 330 | #define U32_HASH_SHIFT 10 | 330 | #define U32_HASH_SHIFT 10 |
| 331 | #define U32_HASH_SIZE (1 << U32_HASH_SHIFT) | 331 | #define U32_HASH_SIZE (1 << U32_HASH_SHIFT) |
| 332 | 332 | ||
| 333 | static void *tc_u_common_ptr(const struct tcf_proto *tp) | ||
| 334 | { | ||
| 335 | struct tcf_block *block = tp->chain->block; | ||
| 336 | |||
| 337 | /* The block sharing is currently supported only | ||
| 338 | * for classless qdiscs. In that case we use block | ||
| 339 | * for tc_u_common identification. In case the | ||
| 340 | * block is not shared, block->q is a valid pointer | ||
| 341 | * and we can use that. That works for classful qdiscs. | ||
| 342 | */ | ||
| 343 | if (tcf_block_shared(block)) | ||
| 344 | return block; | ||
| 345 | else | ||
| 346 | return block->q; | ||
| 347 | } | ||
| 348 | |||
| 333 | static unsigned int tc_u_hash(const struct tcf_proto *tp) | 349 | static unsigned int tc_u_hash(const struct tcf_proto *tp) |
| 334 | { | 350 | { |
| 335 | return hash_ptr(tp->chain->block, U32_HASH_SHIFT); | 351 | return hash_ptr(tc_u_common_ptr(tp), U32_HASH_SHIFT); |
| 336 | } | 352 | } |
| 337 | 353 | ||
| 338 | static struct tc_u_common *tc_u_common_find(const struct tcf_proto *tp) | 354 | static struct tc_u_common *tc_u_common_find(const struct tcf_proto *tp) |
| @@ -342,7 +358,7 @@ static struct tc_u_common *tc_u_common_find(const struct tcf_proto *tp) | |||
| 342 | 358 | ||
| 343 | h = tc_u_hash(tp); | 359 | h = tc_u_hash(tp); |
| 344 | hlist_for_each_entry(tc, &tc_u_common_hash[h], hnode) { | 360 | hlist_for_each_entry(tc, &tc_u_common_hash[h], hnode) { |
| 345 | if (tc->block == tp->chain->block) | 361 | if (tc->ptr == tc_u_common_ptr(tp)) |
| 346 | return tc; | 362 | return tc; |
| 347 | } | 363 | } |
| 348 | return NULL; | 364 | return NULL; |
| @@ -371,7 +387,7 @@ static int u32_init(struct tcf_proto *tp) | |||
| 371 | kfree(root_ht); | 387 | kfree(root_ht); |
| 372 | return -ENOBUFS; | 388 | return -ENOBUFS; |
| 373 | } | 389 | } |
| 374 | tp_c->block = tp->chain->block; | 390 | tp_c->ptr = tc_u_common_ptr(tp); |
| 375 | INIT_HLIST_NODE(&tp_c->hnode); | 391 | INIT_HLIST_NODE(&tp_c->hnode); |
| 376 | idr_init(&tp_c->handle_idr); | 392 | idr_init(&tp_c->handle_idr); |
| 377 | 393 | ||
diff --git a/net/sctp/debug.c b/net/sctp/debug.c index 291c97b07058..8f6c2e8c0953 100644 --- a/net/sctp/debug.c +++ b/net/sctp/debug.c | |||
| @@ -81,6 +81,12 @@ const char *sctp_cname(const union sctp_subtype cid) | |||
| 81 | case SCTP_CID_RECONF: | 81 | case SCTP_CID_RECONF: |
| 82 | return "RECONF"; | 82 | return "RECONF"; |
| 83 | 83 | ||
| 84 | case SCTP_CID_I_DATA: | ||
| 85 | return "I_DATA"; | ||
| 86 | |||
| 87 | case SCTP_CID_I_FWD_TSN: | ||
| 88 | return "I_FWD_TSN"; | ||
| 89 | |||
| 84 | default: | 90 | default: |
| 85 | break; | 91 | break; |
| 86 | } | 92 | } |
diff --git a/net/sctp/input.c b/net/sctp/input.c index 141c9c466ec1..0247cc432e02 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
| @@ -897,15 +897,12 @@ int sctp_hash_transport(struct sctp_transport *t) | |||
| 897 | rhl_for_each_entry_rcu(transport, tmp, list, node) | 897 | rhl_for_each_entry_rcu(transport, tmp, list, node) |
| 898 | if (transport->asoc->ep == t->asoc->ep) { | 898 | if (transport->asoc->ep == t->asoc->ep) { |
| 899 | rcu_read_unlock(); | 899 | rcu_read_unlock(); |
| 900 | err = -EEXIST; | 900 | return -EEXIST; |
| 901 | goto out; | ||
| 902 | } | 901 | } |
| 903 | rcu_read_unlock(); | 902 | rcu_read_unlock(); |
| 904 | 903 | ||
| 905 | err = rhltable_insert_key(&sctp_transport_hashtable, &arg, | 904 | err = rhltable_insert_key(&sctp_transport_hashtable, &arg, |
| 906 | &t->node, sctp_hash_params); | 905 | &t->node, sctp_hash_params); |
| 907 | |||
| 908 | out: | ||
| 909 | if (err) | 906 | if (err) |
| 910 | pr_err_once("insert transport fail, errno %d\n", err); | 907 | pr_err_once("insert transport fail, errno %d\n", err); |
| 911 | 908 | ||
diff --git a/net/sctp/stream.c b/net/sctp/stream.c index cedf672487f9..f799043abec9 100644 --- a/net/sctp/stream.c +++ b/net/sctp/stream.c | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | * | 6 | * |
| 7 | * This file is part of the SCTP kernel implementation | 7 | * This file is part of the SCTP kernel implementation |
| 8 | * | 8 | * |
| 9 | * These functions manipulate sctp tsn mapping array. | 9 | * This file contains sctp stream maniuplation primitives and helpers. |
| 10 | * | 10 | * |
| 11 | * This SCTP implementation is free software; | 11 | * This SCTP implementation is free software; |
| 12 | * you can redistribute it and/or modify it under the terms of | 12 | * you can redistribute it and/or modify it under the terms of |
diff --git a/net/sctp/stream_interleave.c b/net/sctp/stream_interleave.c index 8c7cf8f08711..d3764c181299 100644 --- a/net/sctp/stream_interleave.c +++ b/net/sctp/stream_interleave.c | |||
| @@ -3,7 +3,8 @@ | |||
| 3 | * | 3 | * |
| 4 | * This file is part of the SCTP kernel implementation | 4 | * This file is part of the SCTP kernel implementation |
| 5 | * | 5 | * |
| 6 | * These functions manipulate sctp stream queue/scheduling. | 6 | * These functions implement sctp stream message interleaving, mostly |
| 7 | * including I-DATA and I-FORWARD-TSN chunks process. | ||
| 7 | * | 8 | * |
| 8 | * This SCTP implementation is free software; | 9 | * This SCTP implementation is free software; |
| 9 | * you can redistribute it and/or modify it under the terms of | 10 | * you can redistribute it and/or modify it under the terms of |
| @@ -954,12 +955,8 @@ static void sctp_renege_events(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk, | |||
| 954 | __u32 freed = 0; | 955 | __u32 freed = 0; |
| 955 | __u16 needed; | 956 | __u16 needed; |
| 956 | 957 | ||
| 957 | if (chunk) { | 958 | needed = ntohs(chunk->chunk_hdr->length) - |
| 958 | needed = ntohs(chunk->chunk_hdr->length); | 959 | sizeof(struct sctp_idata_chunk); |
| 959 | needed -= sizeof(struct sctp_idata_chunk); | ||
| 960 | } else { | ||
| 961 | needed = SCTP_DEFAULT_MAXWINDOW; | ||
| 962 | } | ||
| 963 | 960 | ||
| 964 | if (skb_queue_empty(&asoc->base.sk->sk_receive_queue)) { | 961 | if (skb_queue_empty(&asoc->base.sk->sk_receive_queue)) { |
| 965 | freed = sctp_ulpq_renege_list(ulpq, &ulpq->lobby, needed); | 962 | freed = sctp_ulpq_renege_list(ulpq, &ulpq->lobby, needed); |
| @@ -971,9 +968,8 @@ static void sctp_renege_events(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk, | |||
| 971 | needed); | 968 | needed); |
| 972 | } | 969 | } |
| 973 | 970 | ||
| 974 | if (chunk && freed >= needed) | 971 | if (freed >= needed && sctp_ulpevent_idata(ulpq, chunk, gfp) <= 0) |
| 975 | if (sctp_ulpevent_idata(ulpq, chunk, gfp) <= 0) | 972 | sctp_intl_start_pd(ulpq, gfp); |
| 976 | sctp_intl_start_pd(ulpq, gfp); | ||
| 977 | 973 | ||
| 978 | sk_mem_reclaim(asoc->base.sk); | 974 | sk_mem_reclaim(asoc->base.sk); |
| 979 | } | 975 | } |
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 83d284feab1a..f3d2e83313e1 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
| @@ -813,7 +813,7 @@ err_out: | |||
| 813 | return err; | 813 | return err; |
| 814 | } | 814 | } |
| 815 | 815 | ||
| 816 | int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info) | 816 | int __tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info) |
| 817 | { | 817 | { |
| 818 | int err; | 818 | int err; |
| 819 | char *name; | 819 | char *name; |
| @@ -835,20 +835,27 @@ int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info) | |||
| 835 | 835 | ||
| 836 | name = nla_data(attrs[TIPC_NLA_BEARER_NAME]); | 836 | name = nla_data(attrs[TIPC_NLA_BEARER_NAME]); |
| 837 | 837 | ||
| 838 | rtnl_lock(); | ||
| 839 | bearer = tipc_bearer_find(net, name); | 838 | bearer = tipc_bearer_find(net, name); |
| 840 | if (!bearer) { | 839 | if (!bearer) |
| 841 | rtnl_unlock(); | ||
| 842 | return -EINVAL; | 840 | return -EINVAL; |
| 843 | } | ||
| 844 | 841 | ||
| 845 | bearer_disable(net, bearer); | 842 | bearer_disable(net, bearer); |
| 846 | rtnl_unlock(); | ||
| 847 | 843 | ||
| 848 | return 0; | 844 | return 0; |
| 849 | } | 845 | } |
| 850 | 846 | ||
| 851 | int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info) | 847 | int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info) |
| 848 | { | ||
| 849 | int err; | ||
| 850 | |||
| 851 | rtnl_lock(); | ||
| 852 | err = __tipc_nl_bearer_disable(skb, info); | ||
| 853 | rtnl_unlock(); | ||
| 854 | |||
| 855 | return err; | ||
| 856 | } | ||
| 857 | |||
| 858 | int __tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info) | ||
| 852 | { | 859 | { |
| 853 | int err; | 860 | int err; |
| 854 | char *bearer; | 861 | char *bearer; |
| @@ -890,15 +897,18 @@ int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info) | |||
| 890 | prio = nla_get_u32(props[TIPC_NLA_PROP_PRIO]); | 897 | prio = nla_get_u32(props[TIPC_NLA_PROP_PRIO]); |
| 891 | } | 898 | } |
| 892 | 899 | ||
| 900 | return tipc_enable_bearer(net, bearer, domain, prio, attrs); | ||
| 901 | } | ||
| 902 | |||
| 903 | int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info) | ||
| 904 | { | ||
| 905 | int err; | ||
| 906 | |||
| 893 | rtnl_lock(); | 907 | rtnl_lock(); |
| 894 | err = tipc_enable_bearer(net, bearer, domain, prio, attrs); | 908 | err = __tipc_nl_bearer_enable(skb, info); |
| 895 | if (err) { | ||
| 896 | rtnl_unlock(); | ||
| 897 | return err; | ||
| 898 | } | ||
| 899 | rtnl_unlock(); | 909 | rtnl_unlock(); |
| 900 | 910 | ||
| 901 | return 0; | 911 | return err; |
| 902 | } | 912 | } |
| 903 | 913 | ||
| 904 | int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info) | 914 | int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info) |
| @@ -944,7 +954,7 @@ int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info) | |||
| 944 | return 0; | 954 | return 0; |
| 945 | } | 955 | } |
| 946 | 956 | ||
| 947 | int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info) | 957 | int __tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info) |
| 948 | { | 958 | { |
| 949 | struct tipc_bearer *b; | 959 | struct tipc_bearer *b; |
| 950 | struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1]; | 960 | struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1]; |
| @@ -965,22 +975,17 @@ int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info) | |||
| 965 | return -EINVAL; | 975 | return -EINVAL; |
| 966 | name = nla_data(attrs[TIPC_NLA_BEARER_NAME]); | 976 | name = nla_data(attrs[TIPC_NLA_BEARER_NAME]); |
| 967 | 977 | ||
| 968 | rtnl_lock(); | ||
| 969 | b = tipc_bearer_find(net, name); | 978 | b = tipc_bearer_find(net, name); |
| 970 | if (!b) { | 979 | if (!b) |
| 971 | rtnl_unlock(); | ||
| 972 | return -EINVAL; | 980 | return -EINVAL; |
| 973 | } | ||
| 974 | 981 | ||
| 975 | if (attrs[TIPC_NLA_BEARER_PROP]) { | 982 | if (attrs[TIPC_NLA_BEARER_PROP]) { |
| 976 | struct nlattr *props[TIPC_NLA_PROP_MAX + 1]; | 983 | struct nlattr *props[TIPC_NLA_PROP_MAX + 1]; |
| 977 | 984 | ||
| 978 | err = tipc_nl_parse_link_prop(attrs[TIPC_NLA_BEARER_PROP], | 985 | err = tipc_nl_parse_link_prop(attrs[TIPC_NLA_BEARER_PROP], |
| 979 | props); | 986 | props); |
| 980 | if (err) { | 987 | if (err) |
| 981 | rtnl_unlock(); | ||
| 982 | return err; | 988 | return err; |
| 983 | } | ||
| 984 | 989 | ||
| 985 | if (props[TIPC_NLA_PROP_TOL]) { | 990 | if (props[TIPC_NLA_PROP_TOL]) { |
| 986 | b->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]); | 991 | b->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]); |
| @@ -991,11 +996,21 @@ int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info) | |||
| 991 | if (props[TIPC_NLA_PROP_WIN]) | 996 | if (props[TIPC_NLA_PROP_WIN]) |
| 992 | b->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]); | 997 | b->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]); |
| 993 | } | 998 | } |
| 994 | rtnl_unlock(); | ||
| 995 | 999 | ||
| 996 | return 0; | 1000 | return 0; |
| 997 | } | 1001 | } |
| 998 | 1002 | ||
| 1003 | int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info) | ||
| 1004 | { | ||
| 1005 | int err; | ||
| 1006 | |||
| 1007 | rtnl_lock(); | ||
| 1008 | err = __tipc_nl_bearer_set(skb, info); | ||
| 1009 | rtnl_unlock(); | ||
| 1010 | |||
| 1011 | return err; | ||
| 1012 | } | ||
| 1013 | |||
| 999 | static int __tipc_nl_add_media(struct tipc_nl_msg *msg, | 1014 | static int __tipc_nl_add_media(struct tipc_nl_msg *msg, |
| 1000 | struct tipc_media *media, int nlflags) | 1015 | struct tipc_media *media, int nlflags) |
| 1001 | { | 1016 | { |
| @@ -1117,7 +1132,7 @@ err_out: | |||
| 1117 | return err; | 1132 | return err; |
| 1118 | } | 1133 | } |
| 1119 | 1134 | ||
| 1120 | int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info) | 1135 | int __tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info) |
| 1121 | { | 1136 | { |
| 1122 | int err; | 1137 | int err; |
| 1123 | char *name; | 1138 | char *name; |
| @@ -1135,22 +1150,17 @@ int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info) | |||
| 1135 | return -EINVAL; | 1150 | return -EINVAL; |
| 1136 | name = nla_data(attrs[TIPC_NLA_MEDIA_NAME]); | 1151 | name = nla_data(attrs[TIPC_NLA_MEDIA_NAME]); |
| 1137 | 1152 | ||
| 1138 | rtnl_lock(); | ||
| 1139 | m = tipc_media_find(name); | 1153 | m = tipc_media_find(name); |
| 1140 | if (!m) { | 1154 | if (!m) |
| 1141 | rtnl_unlock(); | ||
| 1142 | return -EINVAL; | 1155 | return -EINVAL; |
| 1143 | } | ||
| 1144 | 1156 | ||
| 1145 | if (attrs[TIPC_NLA_MEDIA_PROP]) { | 1157 | if (attrs[TIPC_NLA_MEDIA_PROP]) { |
| 1146 | struct nlattr *props[TIPC_NLA_PROP_MAX + 1]; | 1158 | struct nlattr *props[TIPC_NLA_PROP_MAX + 1]; |
| 1147 | 1159 | ||
| 1148 | err = tipc_nl_parse_link_prop(attrs[TIPC_NLA_MEDIA_PROP], | 1160 | err = tipc_nl_parse_link_prop(attrs[TIPC_NLA_MEDIA_PROP], |
| 1149 | props); | 1161 | props); |
| 1150 | if (err) { | 1162 | if (err) |
| 1151 | rtnl_unlock(); | ||
| 1152 | return err; | 1163 | return err; |
| 1153 | } | ||
| 1154 | 1164 | ||
| 1155 | if (props[TIPC_NLA_PROP_TOL]) | 1165 | if (props[TIPC_NLA_PROP_TOL]) |
| 1156 | m->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]); | 1166 | m->tolerance = nla_get_u32(props[TIPC_NLA_PROP_TOL]); |
| @@ -1159,7 +1169,17 @@ int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info) | |||
| 1159 | if (props[TIPC_NLA_PROP_WIN]) | 1169 | if (props[TIPC_NLA_PROP_WIN]) |
| 1160 | m->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]); | 1170 | m->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]); |
| 1161 | } | 1171 | } |
| 1162 | rtnl_unlock(); | ||
| 1163 | 1172 | ||
| 1164 | return 0; | 1173 | return 0; |
| 1165 | } | 1174 | } |
| 1175 | |||
| 1176 | int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info) | ||
| 1177 | { | ||
| 1178 | int err; | ||
| 1179 | |||
| 1180 | rtnl_lock(); | ||
| 1181 | err = __tipc_nl_media_set(skb, info); | ||
| 1182 | rtnl_unlock(); | ||
| 1183 | |||
| 1184 | return err; | ||
| 1185 | } | ||
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h index 42d6eeeb646d..a53613d95bc9 100644 --- a/net/tipc/bearer.h +++ b/net/tipc/bearer.h | |||
| @@ -188,15 +188,19 @@ extern struct tipc_media udp_media_info; | |||
| 188 | #endif | 188 | #endif |
| 189 | 189 | ||
| 190 | int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info); | 190 | int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info); |
| 191 | int __tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info); | ||
| 191 | int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info); | 192 | int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info); |
| 193 | int __tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info); | ||
| 192 | int tipc_nl_bearer_dump(struct sk_buff *skb, struct netlink_callback *cb); | 194 | int tipc_nl_bearer_dump(struct sk_buff *skb, struct netlink_callback *cb); |
| 193 | int tipc_nl_bearer_get(struct sk_buff *skb, struct genl_info *info); | 195 | int tipc_nl_bearer_get(struct sk_buff *skb, struct genl_info *info); |
| 194 | int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info); | 196 | int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info); |
| 197 | int __tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info); | ||
| 195 | int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info); | 198 | int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info); |
| 196 | 199 | ||
| 197 | int tipc_nl_media_dump(struct sk_buff *skb, struct netlink_callback *cb); | 200 | int tipc_nl_media_dump(struct sk_buff *skb, struct netlink_callback *cb); |
| 198 | int tipc_nl_media_get(struct sk_buff *skb, struct genl_info *info); | 201 | int tipc_nl_media_get(struct sk_buff *skb, struct genl_info *info); |
| 199 | int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info); | 202 | int tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info); |
| 203 | int __tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info); | ||
| 200 | 204 | ||
| 201 | int tipc_media_set_priority(const char *name, u32 new_value); | 205 | int tipc_media_set_priority(const char *name, u32 new_value); |
| 202 | int tipc_media_set_window(const char *name, u32 new_value); | 206 | int tipc_media_set_window(const char *name, u32 new_value); |
diff --git a/net/tipc/net.c b/net/tipc/net.c index 719c5924b638..1a2fde0d6f61 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c | |||
| @@ -200,7 +200,7 @@ out: | |||
| 200 | return skb->len; | 200 | return skb->len; |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info) | 203 | int __tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info) |
| 204 | { | 204 | { |
| 205 | struct net *net = sock_net(skb->sk); | 205 | struct net *net = sock_net(skb->sk); |
| 206 | struct tipc_net *tn = net_generic(net, tipc_net_id); | 206 | struct tipc_net *tn = net_generic(net, tipc_net_id); |
| @@ -241,10 +241,19 @@ int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info) | |||
| 241 | if (!tipc_addr_node_valid(addr)) | 241 | if (!tipc_addr_node_valid(addr)) |
| 242 | return -EINVAL; | 242 | return -EINVAL; |
| 243 | 243 | ||
| 244 | rtnl_lock(); | ||
| 245 | tipc_net_start(net, addr); | 244 | tipc_net_start(net, addr); |
| 246 | rtnl_unlock(); | ||
| 247 | } | 245 | } |
| 248 | 246 | ||
| 249 | return 0; | 247 | return 0; |
| 250 | } | 248 | } |
| 249 | |||
| 250 | int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info) | ||
| 251 | { | ||
| 252 | int err; | ||
| 253 | |||
| 254 | rtnl_lock(); | ||
| 255 | err = __tipc_nl_net_set(skb, info); | ||
| 256 | rtnl_unlock(); | ||
| 257 | |||
| 258 | return err; | ||
| 259 | } | ||
diff --git a/net/tipc/net.h b/net/tipc/net.h index c7c254902873..c0306aa2374b 100644 --- a/net/tipc/net.h +++ b/net/tipc/net.h | |||
| @@ -47,5 +47,6 @@ void tipc_net_stop(struct net *net); | |||
| 47 | 47 | ||
| 48 | int tipc_nl_net_dump(struct sk_buff *skb, struct netlink_callback *cb); | 48 | int tipc_nl_net_dump(struct sk_buff *skb, struct netlink_callback *cb); |
| 49 | int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info); | 49 | int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info); |
| 50 | int __tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info); | ||
| 50 | 51 | ||
| 51 | #endif | 52 | #endif |
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index e48f0b2c01b9..4492cda45566 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c | |||
| @@ -285,10 +285,6 @@ static int __tipc_nl_compat_doit(struct tipc_nl_compat_cmd_doit *cmd, | |||
| 285 | if (!trans_buf) | 285 | if (!trans_buf) |
| 286 | return -ENOMEM; | 286 | return -ENOMEM; |
| 287 | 287 | ||
| 288 | err = (*cmd->transcode)(cmd, trans_buf, msg); | ||
| 289 | if (err) | ||
| 290 | goto trans_out; | ||
| 291 | |||
| 292 | attrbuf = kmalloc((tipc_genl_family.maxattr + 1) * | 288 | attrbuf = kmalloc((tipc_genl_family.maxattr + 1) * |
| 293 | sizeof(struct nlattr *), GFP_KERNEL); | 289 | sizeof(struct nlattr *), GFP_KERNEL); |
| 294 | if (!attrbuf) { | 290 | if (!attrbuf) { |
| @@ -296,27 +292,34 @@ static int __tipc_nl_compat_doit(struct tipc_nl_compat_cmd_doit *cmd, | |||
| 296 | goto trans_out; | 292 | goto trans_out; |
| 297 | } | 293 | } |
| 298 | 294 | ||
| 299 | err = nla_parse(attrbuf, tipc_genl_family.maxattr, | ||
| 300 | (const struct nlattr *)trans_buf->data, | ||
| 301 | trans_buf->len, NULL, NULL); | ||
| 302 | if (err) | ||
| 303 | goto parse_out; | ||
| 304 | |||
| 305 | doit_buf = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); | 295 | doit_buf = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); |
| 306 | if (!doit_buf) { | 296 | if (!doit_buf) { |
| 307 | err = -ENOMEM; | 297 | err = -ENOMEM; |
| 308 | goto parse_out; | 298 | goto attrbuf_out; |
| 309 | } | 299 | } |
| 310 | 300 | ||
| 311 | doit_buf->sk = msg->dst_sk; | ||
| 312 | |||
| 313 | memset(&info, 0, sizeof(info)); | 301 | memset(&info, 0, sizeof(info)); |
| 314 | info.attrs = attrbuf; | 302 | info.attrs = attrbuf; |
| 315 | 303 | ||
| 304 | rtnl_lock(); | ||
| 305 | err = (*cmd->transcode)(cmd, trans_buf, msg); | ||
| 306 | if (err) | ||
| 307 | goto doit_out; | ||
| 308 | |||
| 309 | err = nla_parse(attrbuf, tipc_genl_family.maxattr, | ||
| 310 | (const struct nlattr *)trans_buf->data, | ||
| 311 | trans_buf->len, NULL, NULL); | ||
| 312 | if (err) | ||
| 313 | goto doit_out; | ||
| 314 | |||
| 315 | doit_buf->sk = msg->dst_sk; | ||
| 316 | |||
| 316 | err = (*cmd->doit)(doit_buf, &info); | 317 | err = (*cmd->doit)(doit_buf, &info); |
| 318 | doit_out: | ||
| 319 | rtnl_unlock(); | ||
| 317 | 320 | ||
| 318 | kfree_skb(doit_buf); | 321 | kfree_skb(doit_buf); |
| 319 | parse_out: | 322 | attrbuf_out: |
| 320 | kfree(attrbuf); | 323 | kfree(attrbuf); |
| 321 | trans_out: | 324 | trans_out: |
| 322 | kfree_skb(trans_buf); | 325 | kfree_skb(trans_buf); |
| @@ -722,13 +725,13 @@ static int tipc_nl_compat_link_set(struct tipc_nl_compat_cmd_doit *cmd, | |||
| 722 | 725 | ||
| 723 | media = tipc_media_find(lc->name); | 726 | media = tipc_media_find(lc->name); |
| 724 | if (media) { | 727 | if (media) { |
| 725 | cmd->doit = &tipc_nl_media_set; | 728 | cmd->doit = &__tipc_nl_media_set; |
| 726 | return tipc_nl_compat_media_set(skb, msg); | 729 | return tipc_nl_compat_media_set(skb, msg); |
| 727 | } | 730 | } |
| 728 | 731 | ||
| 729 | bearer = tipc_bearer_find(msg->net, lc->name); | 732 | bearer = tipc_bearer_find(msg->net, lc->name); |
| 730 | if (bearer) { | 733 | if (bearer) { |
| 731 | cmd->doit = &tipc_nl_bearer_set; | 734 | cmd->doit = &__tipc_nl_bearer_set; |
| 732 | return tipc_nl_compat_bearer_set(skb, msg); | 735 | return tipc_nl_compat_bearer_set(skb, msg); |
| 733 | } | 736 | } |
| 734 | 737 | ||
| @@ -1089,12 +1092,12 @@ static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg) | |||
| 1089 | return tipc_nl_compat_dumpit(&dump, msg); | 1092 | return tipc_nl_compat_dumpit(&dump, msg); |
| 1090 | case TIPC_CMD_ENABLE_BEARER: | 1093 | case TIPC_CMD_ENABLE_BEARER: |
| 1091 | msg->req_type = TIPC_TLV_BEARER_CONFIG; | 1094 | msg->req_type = TIPC_TLV_BEARER_CONFIG; |
| 1092 | doit.doit = tipc_nl_bearer_enable; | 1095 | doit.doit = __tipc_nl_bearer_enable; |
| 1093 | doit.transcode = tipc_nl_compat_bearer_enable; | 1096 | doit.transcode = tipc_nl_compat_bearer_enable; |
| 1094 | return tipc_nl_compat_doit(&doit, msg); | 1097 | return tipc_nl_compat_doit(&doit, msg); |
| 1095 | case TIPC_CMD_DISABLE_BEARER: | 1098 | case TIPC_CMD_DISABLE_BEARER: |
| 1096 | msg->req_type = TIPC_TLV_BEARER_NAME; | 1099 | msg->req_type = TIPC_TLV_BEARER_NAME; |
| 1097 | doit.doit = tipc_nl_bearer_disable; | 1100 | doit.doit = __tipc_nl_bearer_disable; |
| 1098 | doit.transcode = tipc_nl_compat_bearer_disable; | 1101 | doit.transcode = tipc_nl_compat_bearer_disable; |
| 1099 | return tipc_nl_compat_doit(&doit, msg); | 1102 | return tipc_nl_compat_doit(&doit, msg); |
| 1100 | case TIPC_CMD_SHOW_LINK_STATS: | 1103 | case TIPC_CMD_SHOW_LINK_STATS: |
| @@ -1148,12 +1151,12 @@ static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg) | |||
| 1148 | return tipc_nl_compat_dumpit(&dump, msg); | 1151 | return tipc_nl_compat_dumpit(&dump, msg); |
| 1149 | case TIPC_CMD_SET_NODE_ADDR: | 1152 | case TIPC_CMD_SET_NODE_ADDR: |
| 1150 | msg->req_type = TIPC_TLV_NET_ADDR; | 1153 | msg->req_type = TIPC_TLV_NET_ADDR; |
| 1151 | doit.doit = tipc_nl_net_set; | 1154 | doit.doit = __tipc_nl_net_set; |
| 1152 | doit.transcode = tipc_nl_compat_net_set; | 1155 | doit.transcode = tipc_nl_compat_net_set; |
| 1153 | return tipc_nl_compat_doit(&doit, msg); | 1156 | return tipc_nl_compat_doit(&doit, msg); |
| 1154 | case TIPC_CMD_SET_NETID: | 1157 | case TIPC_CMD_SET_NETID: |
| 1155 | msg->req_type = TIPC_TLV_UNSIGNED; | 1158 | msg->req_type = TIPC_TLV_UNSIGNED; |
| 1156 | doit.doit = tipc_nl_net_set; | 1159 | doit.doit = __tipc_nl_net_set; |
| 1157 | doit.transcode = tipc_nl_compat_net_set; | 1160 | doit.transcode = tipc_nl_compat_net_set; |
| 1158 | return tipc_nl_compat_doit(&doit, msg); | 1161 | return tipc_nl_compat_doit(&doit, msg); |
| 1159 | case TIPC_CMD_GET_NETID: | 1162 | case TIPC_CMD_GET_NETID: |
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index b0d5fcea47e7..e9b4b53ab53e 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c | |||
| @@ -308,8 +308,11 @@ static int do_tls_getsockopt_tx(struct sock *sk, char __user *optval, | |||
| 308 | goto out; | 308 | goto out; |
| 309 | } | 309 | } |
| 310 | lock_sock(sk); | 310 | lock_sock(sk); |
| 311 | memcpy(crypto_info_aes_gcm_128->iv, ctx->iv, | 311 | memcpy(crypto_info_aes_gcm_128->iv, |
| 312 | ctx->iv + TLS_CIPHER_AES_GCM_128_SALT_SIZE, | ||
| 312 | TLS_CIPHER_AES_GCM_128_IV_SIZE); | 313 | TLS_CIPHER_AES_GCM_128_IV_SIZE); |
| 314 | memcpy(crypto_info_aes_gcm_128->rec_seq, ctx->rec_seq, | ||
| 315 | TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE); | ||
| 313 | release_sock(sk); | 316 | release_sock(sk); |
| 314 | if (copy_to_user(optval, | 317 | if (copy_to_user(optval, |
| 315 | crypto_info_aes_gcm_128, | 318 | crypto_info_aes_gcm_128, |
| @@ -375,7 +378,7 @@ static int do_tls_setsockopt_tx(struct sock *sk, char __user *optval, | |||
| 375 | rc = copy_from_user(crypto_info, optval, sizeof(*crypto_info)); | 378 | rc = copy_from_user(crypto_info, optval, sizeof(*crypto_info)); |
| 376 | if (rc) { | 379 | if (rc) { |
| 377 | rc = -EFAULT; | 380 | rc = -EFAULT; |
| 378 | goto out; | 381 | goto err_crypto_info; |
| 379 | } | 382 | } |
| 380 | 383 | ||
| 381 | /* check version */ | 384 | /* check version */ |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index e3eb8806b3e4..bc2970a8e7f3 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
| @@ -1825,7 +1825,7 @@ out: | |||
| 1825 | } | 1825 | } |
| 1826 | 1826 | ||
| 1827 | /* We use paged skbs for stream sockets, and limit occupancy to 32768 | 1827 | /* We use paged skbs for stream sockets, and limit occupancy to 32768 |
| 1828 | * bytes, and a minimun of a full page. | 1828 | * bytes, and a minimum of a full page. |
| 1829 | */ | 1829 | */ |
| 1830 | #define UNIX_SKB_FRAGS_SZ (PAGE_SIZE << get_order(32768)) | 1830 | #define UNIX_SKB_FRAGS_SZ (PAGE_SIZE << get_order(32768)) |
| 1831 | 1831 | ||
