aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLCPD Auto Merger2017-08-11 17:09:21 -0500
committerLCPD Auto Merger2017-08-11 17:09:21 -0500
commit78f902ff441b17f8a3c51e0211fa69c052e9cbbe (patch)
treee47bdab6d819967090132287147c25b678c1aeac /net
parent6b415f3f89f392f08b4bcb2d8f24d644fe3e0497 (diff)
parent2ab639c7e2d1f02779c8947c90d8d595f5843e52 (diff)
downloadkernel-omap-78f902ff441b17f8a3c51e0211fa69c052e9cbbe.tar.gz
kernel-omap-78f902ff441b17f8a3c51e0211fa69c052e9cbbe.tar.xz
kernel-omap-78f902ff441b17f8a3c51e0211fa69c052e9cbbe.zip
Merge tag 'v4.4.81' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into ti-linux-4.4.y
This is the 4.4.81 stable release * tag 'v4.4.81' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (59 commits) Linux 4.4.81 workqueue: implicit ordered attribute should be overridable net: account for current skb length when deciding about UFO ipv4: Should use consistent conditional judgement for ip fragment in __ip_append_data and ip_finish_output mm: don't dereference struct page fields of invalid pages signal: protect SIGNAL_UNKILLABLE from unintentional clearing. lib/Kconfig.debug: fix frv build failure mm, slab: make sure that KMALLOC_MAX_SIZE will fit into MAX_ORDER ARM: 8632/1: ftrace: fix syscall name matching virtio_blk: fix panic in initialization error path drm/virtio: fix framebuffer sparse warning scsi: qla2xxx: Get mutex lock before checking optrom_state phy state machine: failsafe leave invalid RUNNING state x86/boot: Add missing declaration of string functions tg3: Fix race condition in tg3_get_stats64(). net: phy: dp83867: fix irq generation sh_eth: R8A7740 supports packet shecksumming wext: handle NULL extra data in iwe_stream_add_point better sparc64: Measure receiver forward progress to avoid send mondo timeout xen-netback: correctly schedule rate-limited queues ... Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev_ioctl.c1
-rw-r--r--net/core/rtnetlink.c3
-rw-r--r--net/dccp/feat.c7
-rw-r--r--net/dccp/ipv4.c1
-rw-r--r--net/dccp/ipv6.c1
-rw-r--r--net/ipv4/fib_frontend.c9
-rw-r--r--net/ipv4/ip_output.c3
-rw-r--r--net/ipv4/syncookies.c1
-rw-r--r--net/ipv6/ip6_output.c6
-rw-r--r--net/ipv6/output_core.c8
-rw-r--r--net/ipv6/syncookies.c1
-rw-r--r--net/openvswitch/conntrack.c7
-rw-r--r--net/packet/af_packet.c2
13 files changed, 32 insertions, 18 deletions
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 183ef95db502..2bded3ecf03d 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -28,6 +28,7 @@ static int dev_ifname(struct net *net, struct ifreq __user *arg)
28 28
29 if (copy_from_user(&ifr, arg, sizeof(struct ifreq))) 29 if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
30 return -EFAULT; 30 return -EFAULT;
31 ifr.ifr_name[IFNAMSIZ-1] = 0;
31 32
32 error = netdev_get_name(net, ifr.ifr_name, ifr.ifr_ifindex); 33 error = netdev_get_name(net, ifr.ifr_name, ifr.ifr_ifindex);
33 if (error) 34 if (error)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 2ec5324a7ff7..5b3d611d8b5f 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1742,7 +1742,8 @@ static int do_setlink(const struct sk_buff *skb,
1742 struct sockaddr *sa; 1742 struct sockaddr *sa;
1743 int len; 1743 int len;
1744 1744
1745 len = sizeof(sa_family_t) + dev->addr_len; 1745 len = sizeof(sa_family_t) + max_t(size_t, dev->addr_len,
1746 sizeof(*sa));
1746 sa = kmalloc(len, GFP_KERNEL); 1747 sa = kmalloc(len, GFP_KERNEL);
1747 if (!sa) { 1748 if (!sa) {
1748 err = -ENOMEM; 1749 err = -ENOMEM;
diff --git a/net/dccp/feat.c b/net/dccp/feat.c
index 1704948e6a12..f227f002c73d 100644
--- a/net/dccp/feat.c
+++ b/net/dccp/feat.c
@@ -1471,9 +1471,12 @@ int dccp_feat_init(struct sock *sk)
1471 * singleton values (which always leads to failure). 1471 * singleton values (which always leads to failure).
1472 * These settings can still (later) be overridden via sockopts. 1472 * These settings can still (later) be overridden via sockopts.
1473 */ 1473 */
1474 if (ccid_get_builtin_ccids(&tx.val, &tx.len) || 1474 if (ccid_get_builtin_ccids(&tx.val, &tx.len))
1475 ccid_get_builtin_ccids(&rx.val, &rx.len))
1476 return -ENOBUFS; 1475 return -ENOBUFS;
1476 if (ccid_get_builtin_ccids(&rx.val, &rx.len)) {
1477 kfree(tx.val);
1478 return -ENOBUFS;
1479 }
1477 1480
1478 if (!dccp_feat_prefer(sysctl_dccp_tx_ccid, tx.val, tx.len) || 1481 if (!dccp_feat_prefer(sysctl_dccp_tx_ccid, tx.val, tx.len) ||
1479 !dccp_feat_prefer(sysctl_dccp_rx_ccid, rx.val, rx.len)) 1482 !dccp_feat_prefer(sysctl_dccp_rx_ccid, rx.val, rx.len))
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 6467bf392e1b..e217f17997a4 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -635,6 +635,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
635 goto drop_and_free; 635 goto drop_and_free;
636 636
637 inet_csk_reqsk_queue_hash_add(sk, req, DCCP_TIMEOUT_INIT); 637 inet_csk_reqsk_queue_hash_add(sk, req, DCCP_TIMEOUT_INIT);
638 reqsk_put(req);
638 return 0; 639 return 0;
639 640
640drop_and_free: 641drop_and_free:
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 3470ad1843bb..09a9ab65f4e1 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -376,6 +376,7 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
376 goto drop_and_free; 376 goto drop_and_free;
377 377
378 inet_csk_reqsk_queue_hash_add(sk, req, DCCP_TIMEOUT_INIT); 378 inet_csk_reqsk_queue_hash_add(sk, req, DCCP_TIMEOUT_INIT);
379 reqsk_put(req);
379 return 0; 380 return 0;
380 381
381drop_and_free: 382drop_and_free:
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 66dcb529fd9c..0cb240c749bf 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1319,13 +1319,14 @@ static struct pernet_operations fib_net_ops = {
1319 1319
1320void __init ip_fib_init(void) 1320void __init ip_fib_init(void)
1321{ 1321{
1322 rtnl_register(PF_INET, RTM_NEWROUTE, inet_rtm_newroute, NULL, NULL); 1322 fib_trie_init();
1323 rtnl_register(PF_INET, RTM_DELROUTE, inet_rtm_delroute, NULL, NULL);
1324 rtnl_register(PF_INET, RTM_GETROUTE, NULL, inet_dump_fib, NULL);
1325 1323
1326 register_pernet_subsys(&fib_net_ops); 1324 register_pernet_subsys(&fib_net_ops);
1325
1327 register_netdevice_notifier(&fib_netdev_notifier); 1326 register_netdevice_notifier(&fib_netdev_notifier);
1328 register_inetaddr_notifier(&fib_inetaddr_notifier); 1327 register_inetaddr_notifier(&fib_inetaddr_notifier);
1329 1328
1330 fib_trie_init(); 1329 rtnl_register(PF_INET, RTM_NEWROUTE, inet_rtm_newroute, NULL, NULL);
1330 rtnl_register(PF_INET, RTM_DELROUTE, inet_rtm_delroute, NULL, NULL);
1331 rtnl_register(PF_INET, RTM_GETROUTE, NULL, inet_dump_fib, NULL);
1331} 1332}
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 2b7283303650..5d58a6703a43 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -922,7 +922,8 @@ static int __ip_append_data(struct sock *sk,
922 csummode = CHECKSUM_PARTIAL; 922 csummode = CHECKSUM_PARTIAL;
923 923
924 cork->length += length; 924 cork->length += length;
925 if (((length > mtu) || (skb && skb_is_gso(skb))) && 925 if ((((length + (skb ? skb->len : fragheaderlen)) > mtu) ||
926 (skb && skb_is_gso(skb))) &&
926 (sk->sk_protocol == IPPROTO_UDP) && 927 (sk->sk_protocol == IPPROTO_UDP) &&
927 (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len && 928 (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len &&
928 (sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx) { 929 (sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx) {
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 4cbe9f0a4281..731b91409625 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -337,6 +337,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
337 treq = tcp_rsk(req); 337 treq = tcp_rsk(req);
338 treq->rcv_isn = ntohl(th->seq) - 1; 338 treq->rcv_isn = ntohl(th->seq) - 1;
339 treq->snt_isn = cookie; 339 treq->snt_isn = cookie;
340 treq->txhash = net_tx_rndhash();
340 req->mss = mss; 341 req->mss = mss;
341 ireq->ir_num = ntohs(th->dest); 342 ireq->ir_num = ntohs(th->dest);
342 ireq->ir_rmt_port = th->source; 343 ireq->ir_rmt_port = th->source;
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 150b4923fb72..0de3245ea42f 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -647,8 +647,6 @@ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
647 *prevhdr = NEXTHDR_FRAGMENT; 647 *prevhdr = NEXTHDR_FRAGMENT;
648 tmp_hdr = kmemdup(skb_network_header(skb), hlen, GFP_ATOMIC); 648 tmp_hdr = kmemdup(skb_network_header(skb), hlen, GFP_ATOMIC);
649 if (!tmp_hdr) { 649 if (!tmp_hdr) {
650 IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
651 IPSTATS_MIB_FRAGFAILS);
652 err = -ENOMEM; 650 err = -ENOMEM;
653 goto fail; 651 goto fail;
654 } 652 }
@@ -767,8 +765,6 @@ slow_path:
767 frag = alloc_skb(len + hlen + sizeof(struct frag_hdr) + 765 frag = alloc_skb(len + hlen + sizeof(struct frag_hdr) +
768 hroom + troom, GFP_ATOMIC); 766 hroom + troom, GFP_ATOMIC);
769 if (!frag) { 767 if (!frag) {
770 IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
771 IPSTATS_MIB_FRAGFAILS);
772 err = -ENOMEM; 768 err = -ENOMEM;
773 goto fail; 769 goto fail;
774 } 770 }
@@ -1361,7 +1357,7 @@ emsgsize:
1361 */ 1357 */
1362 1358
1363 cork->length += length; 1359 cork->length += length;
1364 if ((((length + fragheaderlen) > mtu) || 1360 if ((((length + (skb ? skb->len : headersize)) > mtu) ||
1365 (skb && skb_is_gso(skb))) && 1361 (skb && skb_is_gso(skb))) &&
1366 (sk->sk_protocol == IPPROTO_UDP) && 1362 (sk->sk_protocol == IPPROTO_UDP) &&
1367 (rt->dst.dev->features & NETIF_F_UFO) && 1363 (rt->dst.dev->features & NETIF_F_UFO) &&
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c
index 8b56c5240429..f9f02581c4ca 100644
--- a/net/ipv6/output_core.c
+++ b/net/ipv6/output_core.c
@@ -78,7 +78,7 @@ EXPORT_SYMBOL(ipv6_select_ident);
78 78
79int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr) 79int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
80{ 80{
81 u16 offset = sizeof(struct ipv6hdr); 81 unsigned int offset = sizeof(struct ipv6hdr);
82 unsigned int packet_len = skb_tail_pointer(skb) - 82 unsigned int packet_len = skb_tail_pointer(skb) -
83 skb_network_header(skb); 83 skb_network_header(skb);
84 int found_rhdr = 0; 84 int found_rhdr = 0;
@@ -86,6 +86,7 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
86 86
87 while (offset <= packet_len) { 87 while (offset <= packet_len) {
88 struct ipv6_opt_hdr *exthdr; 88 struct ipv6_opt_hdr *exthdr;
89 unsigned int len;
89 90
90 switch (**nexthdr) { 91 switch (**nexthdr) {
91 92
@@ -111,7 +112,10 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
111 112
112 exthdr = (struct ipv6_opt_hdr *)(skb_network_header(skb) + 113 exthdr = (struct ipv6_opt_hdr *)(skb_network_header(skb) +
113 offset); 114 offset);
114 offset += ipv6_optlen(exthdr); 115 len = ipv6_optlen(exthdr);
116 if (len + offset >= IPV6_MAXPLEN)
117 return -EINVAL;
118 offset += len;
115 *nexthdr = &exthdr->nexthdr; 119 *nexthdr = &exthdr->nexthdr;
116 } 120 }
117 121
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index eaf7ac496d50..aee87282d352 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -210,6 +210,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
210 treq->snt_synack.v64 = 0; 210 treq->snt_synack.v64 = 0;
211 treq->rcv_isn = ntohl(th->seq) - 1; 211 treq->rcv_isn = ntohl(th->seq) - 1;
212 treq->snt_isn = cookie; 212 treq->snt_isn = cookie;
213 treq->txhash = net_tx_rndhash();
213 214
214 /* 215 /*
215 * We need to lookup the dst_entry to get the correct window size. 216 * We need to lookup the dst_entry to get the correct window size.
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index ad58d2a6284e..6a2507f24b0f 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -577,8 +577,8 @@ static int parse_ct(const struct nlattr *attr, struct ovs_conntrack_info *info,
577 577
578 nla_for_each_nested(a, attr, rem) { 578 nla_for_each_nested(a, attr, rem) {
579 int type = nla_type(a); 579 int type = nla_type(a);
580 int maxlen = ovs_ct_attr_lens[type].maxlen; 580 int maxlen;
581 int minlen = ovs_ct_attr_lens[type].minlen; 581 int minlen;
582 582
583 if (type > OVS_CT_ATTR_MAX) { 583 if (type > OVS_CT_ATTR_MAX) {
584 OVS_NLERR(log, 584 OVS_NLERR(log,
@@ -586,6 +586,9 @@ static int parse_ct(const struct nlattr *attr, struct ovs_conntrack_info *info,
586 type, OVS_CT_ATTR_MAX); 586 type, OVS_CT_ATTR_MAX);
587 return -EINVAL; 587 return -EINVAL;
588 } 588 }
589
590 maxlen = ovs_ct_attr_lens[type].maxlen;
591 minlen = ovs_ct_attr_lens[type].minlen;
589 if (nla_len(a) < minlen || nla_len(a) > maxlen) { 592 if (nla_len(a) < minlen || nla_len(a) > maxlen) {
590 OVS_NLERR(log, 593 OVS_NLERR(log,
591 "Conntrack attr type has unexpected length (type=%d, length=%d, expected=%d)", 594 "Conntrack attr type has unexpected length (type=%d, length=%d, expected=%d)",
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index f8d6a0ca9c03..061771ca2582 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -4225,7 +4225,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
4225 register_prot_hook(sk); 4225 register_prot_hook(sk);
4226 } 4226 }
4227 spin_unlock(&po->bind_lock); 4227 spin_unlock(&po->bind_lock);
4228 if (closing && (po->tp_version > TPACKET_V2)) { 4228 if (pg_vec && (po->tp_version > TPACKET_V2)) {
4229 /* Because we don't support block-based V3 on tx-ring */ 4229 /* Because we don't support block-based V3 on tx-ring */
4230 if (!tx_ring) 4230 if (!tx_ring)
4231 prb_shutdown_retire_blk_timer(po, rb_queue); 4231 prb_shutdown_retire_blk_timer(po, rb_queue);