diff options
author | Brian Norris <computersforpeace@gmail.com> | 2017-06-01 13:53:55 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2017-06-01 13:53:55 -0400 |
commit | 05e97a9eda72d58dba293857df6aac62584ef99a (patch) | |
tree | e86e692f26d4879ff2210c54722e2b7780210249 /net/ipv6 | |
parent | 2ea659a9ef488125eb46da6eb571de5eae5c43f6 (diff) | |
parent | d4ed3b9015b5eebc90d629579d9e7944607cbae5 (diff) |
Merge tag 'nand/fixes-for-4.12-rc3' of git://git.infradead.org/linux-mtd into MTD
From Boris:
"""
This pull request contains several fixes to the core and the tango
driver.
tango fixes:
* Add missing MODULE_DEVICE_TABLE() in tango_nand.c
* Update the number of corrected bitflips
core fixes:
* Fix a long standing memory leak in nand_scan_tail()
* Fix several bugs introduced by the per-vendor init/detection
infrastructure (introduced in 4.12)
* Add a static specifier to nand_ooblayout_lp_hamming_ops definition
"""
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 5 | ||||
-rw-r--r-- | net/ipv6/ip6_offload.c | 7 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 5 | ||||
-rw-r--r-- | net/ipv6/output_core.c | 14 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 2 | ||||
-rw-r--r-- | net/ipv6/udp.c | 4 | ||||
-rw-r--r-- | net/ipv6/udp_impl.h | 1 | ||||
-rw-r--r-- | net/ipv6/udp_offload.c | 6 |
8 files changed, 29 insertions, 15 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 8d297a79b568..6a4fb1e629fb 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1022,7 +1022,10 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr, | |||
1022 | INIT_HLIST_NODE(&ifa->addr_lst); | 1022 | INIT_HLIST_NODE(&ifa->addr_lst); |
1023 | ifa->scope = scope; | 1023 | ifa->scope = scope; |
1024 | ifa->prefix_len = pfxlen; | 1024 | ifa->prefix_len = pfxlen; |
1025 | ifa->flags = flags | IFA_F_TENTATIVE; | 1025 | ifa->flags = flags; |
1026 | /* No need to add the TENTATIVE flag for addresses with NODAD */ | ||
1027 | if (!(flags & IFA_F_NODAD)) | ||
1028 | ifa->flags |= IFA_F_TENTATIVE; | ||
1026 | ifa->valid_lft = valid_lft; | 1029 | ifa->valid_lft = valid_lft; |
1027 | ifa->prefered_lft = prefered_lft; | 1030 | ifa->prefered_lft = prefered_lft; |
1028 | ifa->cstamp = ifa->tstamp = jiffies; | 1031 | ifa->cstamp = ifa->tstamp = jiffies; |
diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c index 93e58a5e1837..280268f1dd7b 100644 --- a/net/ipv6/ip6_offload.c +++ b/net/ipv6/ip6_offload.c | |||
@@ -63,7 +63,6 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, | |||
63 | const struct net_offload *ops; | 63 | const struct net_offload *ops; |
64 | int proto; | 64 | int proto; |
65 | struct frag_hdr *fptr; | 65 | struct frag_hdr *fptr; |
66 | unsigned int unfrag_ip6hlen; | ||
67 | unsigned int payload_len; | 66 | unsigned int payload_len; |
68 | u8 *prevhdr; | 67 | u8 *prevhdr; |
69 | int offset = 0; | 68 | int offset = 0; |
@@ -116,8 +115,10 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, | |||
116 | skb->network_header = (u8 *)ipv6h - skb->head; | 115 | skb->network_header = (u8 *)ipv6h - skb->head; |
117 | 116 | ||
118 | if (udpfrag) { | 117 | if (udpfrag) { |
119 | unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr); | 118 | int err = ip6_find_1stfragopt(skb, &prevhdr); |
120 | fptr = (struct frag_hdr *)((u8 *)ipv6h + unfrag_ip6hlen); | 119 | if (err < 0) |
120 | return ERR_PTR(err); | ||
121 | fptr = (struct frag_hdr *)((u8 *)ipv6h + err); | ||
121 | fptr->frag_off = htons(offset); | 122 | fptr->frag_off = htons(offset); |
122 | if (skb->next) | 123 | if (skb->next) |
123 | fptr->frag_off |= htons(IP6_MF); | 124 | fptr->frag_off |= htons(IP6_MF); |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 58f6288e9ba5..d4a31becbd25 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -597,7 +597,10 @@ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, | |||
597 | int ptr, offset = 0, err = 0; | 597 | int ptr, offset = 0, err = 0; |
598 | u8 *prevhdr, nexthdr = 0; | 598 | u8 *prevhdr, nexthdr = 0; |
599 | 599 | ||
600 | hlen = ip6_find_1stfragopt(skb, &prevhdr); | 600 | err = ip6_find_1stfragopt(skb, &prevhdr); |
601 | if (err < 0) | ||
602 | goto fail; | ||
603 | hlen = err; | ||
601 | nexthdr = *prevhdr; | 604 | nexthdr = *prevhdr; |
602 | 605 | ||
603 | mtu = ip6_skb_dst_mtu(skb); | 606 | mtu = ip6_skb_dst_mtu(skb); |
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c index cd4252346a32..e9065b8d3af8 100644 --- a/net/ipv6/output_core.c +++ b/net/ipv6/output_core.c | |||
@@ -79,14 +79,13 @@ EXPORT_SYMBOL(ipv6_select_ident); | |||
79 | int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr) | 79 | int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr) |
80 | { | 80 | { |
81 | u16 offset = sizeof(struct ipv6hdr); | 81 | u16 offset = sizeof(struct ipv6hdr); |
82 | struct ipv6_opt_hdr *exthdr = | ||
83 | (struct ipv6_opt_hdr *)(ipv6_hdr(skb) + 1); | ||
84 | unsigned int packet_len = skb_tail_pointer(skb) - | 82 | unsigned int packet_len = skb_tail_pointer(skb) - |
85 | skb_network_header(skb); | 83 | skb_network_header(skb); |
86 | int found_rhdr = 0; | 84 | int found_rhdr = 0; |
87 | *nexthdr = &ipv6_hdr(skb)->nexthdr; | 85 | *nexthdr = &ipv6_hdr(skb)->nexthdr; |
88 | 86 | ||
89 | while (offset + 1 <= packet_len) { | 87 | while (offset <= packet_len) { |
88 | struct ipv6_opt_hdr *exthdr; | ||
90 | 89 | ||
91 | switch (**nexthdr) { | 90 | switch (**nexthdr) { |
92 | 91 | ||
@@ -107,13 +106,16 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr) | |||
107 | return offset; | 106 | return offset; |
108 | } | 107 | } |
109 | 108 | ||
110 | offset += ipv6_optlen(exthdr); | 109 | if (offset + sizeof(struct ipv6_opt_hdr) > packet_len) |
111 | *nexthdr = &exthdr->nexthdr; | 110 | return -EINVAL; |
111 | |||
112 | exthdr = (struct ipv6_opt_hdr *)(skb_network_header(skb) + | 112 | exthdr = (struct ipv6_opt_hdr *)(skb_network_header(skb) + |
113 | offset); | 113 | offset); |
114 | offset += ipv6_optlen(exthdr); | ||
115 | *nexthdr = &exthdr->nexthdr; | ||
114 | } | 116 | } |
115 | 117 | ||
116 | return offset; | 118 | return -EINVAL; |
117 | } | 119 | } |
118 | EXPORT_SYMBOL(ip6_find_1stfragopt); | 120 | EXPORT_SYMBOL(ip6_find_1stfragopt); |
119 | 121 | ||
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 7a8237acd210..4f4310a36a04 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1062,6 +1062,7 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff * | |||
1062 | newtp->af_specific = &tcp_sock_ipv6_mapped_specific; | 1062 | newtp->af_specific = &tcp_sock_ipv6_mapped_specific; |
1063 | #endif | 1063 | #endif |
1064 | 1064 | ||
1065 | newnp->ipv6_mc_list = NULL; | ||
1065 | newnp->ipv6_ac_list = NULL; | 1066 | newnp->ipv6_ac_list = NULL; |
1066 | newnp->ipv6_fl_list = NULL; | 1067 | newnp->ipv6_fl_list = NULL; |
1067 | newnp->pktoptions = NULL; | 1068 | newnp->pktoptions = NULL; |
@@ -1131,6 +1132,7 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff * | |||
1131 | First: no IPv4 options. | 1132 | First: no IPv4 options. |
1132 | */ | 1133 | */ |
1133 | newinet->inet_opt = NULL; | 1134 | newinet->inet_opt = NULL; |
1135 | newnp->ipv6_mc_list = NULL; | ||
1134 | newnp->ipv6_ac_list = NULL; | 1136 | newnp->ipv6_ac_list = NULL; |
1135 | newnp->ipv6_fl_list = NULL; | 1137 | newnp->ipv6_fl_list = NULL; |
1136 | 1138 | ||
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 04862abfe4ec..06ec39b79609 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -526,7 +526,7 @@ out: | |||
526 | return; | 526 | return; |
527 | } | 527 | } |
528 | 528 | ||
529 | int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | 529 | static int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) |
530 | { | 530 | { |
531 | int rc; | 531 | int rc; |
532 | 532 | ||
@@ -569,7 +569,7 @@ void udpv6_encap_enable(void) | |||
569 | } | 569 | } |
570 | EXPORT_SYMBOL(udpv6_encap_enable); | 570 | EXPORT_SYMBOL(udpv6_encap_enable); |
571 | 571 | ||
572 | int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | 572 | static int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) |
573 | { | 573 | { |
574 | struct udp_sock *up = udp_sk(sk); | 574 | struct udp_sock *up = udp_sk(sk); |
575 | int is_udplite = IS_UDPLITE(sk); | 575 | int is_udplite = IS_UDPLITE(sk); |
diff --git a/net/ipv6/udp_impl.h b/net/ipv6/udp_impl.h index e78bdc76dcc3..f180b3d85e31 100644 --- a/net/ipv6/udp_impl.h +++ b/net/ipv6/udp_impl.h | |||
@@ -26,7 +26,6 @@ int compat_udpv6_getsockopt(struct sock *sk, int level, int optname, | |||
26 | int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len); | 26 | int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len); |
27 | int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock, | 27 | int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock, |
28 | int flags, int *addr_len); | 28 | int flags, int *addr_len); |
29 | int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | ||
30 | void udpv6_destroy_sock(struct sock *sk); | 29 | void udpv6_destroy_sock(struct sock *sk); |
31 | 30 | ||
32 | #ifdef CONFIG_PROC_FS | 31 | #ifdef CONFIG_PROC_FS |
diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c index ac858c480f2f..a2267f80febb 100644 --- a/net/ipv6/udp_offload.c +++ b/net/ipv6/udp_offload.c | |||
@@ -29,6 +29,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, | |||
29 | u8 frag_hdr_sz = sizeof(struct frag_hdr); | 29 | u8 frag_hdr_sz = sizeof(struct frag_hdr); |
30 | __wsum csum; | 30 | __wsum csum; |
31 | int tnl_hlen; | 31 | int tnl_hlen; |
32 | int err; | ||
32 | 33 | ||
33 | mss = skb_shinfo(skb)->gso_size; | 34 | mss = skb_shinfo(skb)->gso_size; |
34 | if (unlikely(skb->len <= mss)) | 35 | if (unlikely(skb->len <= mss)) |
@@ -90,7 +91,10 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, | |||
90 | /* Find the unfragmentable header and shift it left by frag_hdr_sz | 91 | /* Find the unfragmentable header and shift it left by frag_hdr_sz |
91 | * bytes to insert fragment header. | 92 | * bytes to insert fragment header. |
92 | */ | 93 | */ |
93 | unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr); | 94 | err = ip6_find_1stfragopt(skb, &prevhdr); |
95 | if (err < 0) | ||
96 | return ERR_PTR(err); | ||
97 | unfrag_ip6hlen = err; | ||
94 | nexthdr = *prevhdr; | 98 | nexthdr = *prevhdr; |
95 | *prevhdr = NEXTHDR_FRAGMENT; | 99 | *prevhdr = NEXTHDR_FRAGMENT; |
96 | unfrag_len = (skb_network_header(skb) - skb_mac_header(skb)) + | 100 | unfrag_len = (skb_network_header(skb) - skb_mac_header(skb)) + |