Revert "udp: consistently apply ufo or fragmentation"

This reverts commit 840d468d.

CVE-2017-1000112
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent a8bfc5dc
...@@ -922,12 +922,11 @@ static int __ip_append_data(struct sock *sk, ...@@ -922,12 +922,11 @@ static int __ip_append_data(struct sock *sk,
csummode = CHECKSUM_PARTIAL; csummode = CHECKSUM_PARTIAL;
cork->length += length; cork->length += length;
if ((skb && skb_is_gso(skb)) || if ((((length + (skb ? skb->len : fragheaderlen)) > mtu) ||
(((length + (skb ? skb->len : fragheaderlen)) > mtu) && (skb && skb_is_gso(skb))) &&
(skb_queue_len(queue) <= 1) &&
(sk->sk_protocol == IPPROTO_UDP) && (sk->sk_protocol == IPPROTO_UDP) &&
(rt->dst.dev->features & NETIF_F_UFO) && !dst_xfrm(&rt->dst) && (rt->dst.dev->features & NETIF_F_UFO) && !dst_xfrm(&rt->dst) &&
(sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx)) { (sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx) {
err = ip_ufo_append_data(sk, queue, getfrag, from, length, err = ip_ufo_append_data(sk, queue, getfrag, from, length,
hh_len, fragheaderlen, transhdrlen, hh_len, fragheaderlen, transhdrlen,
maxfraglen, flags); maxfraglen, flags);
...@@ -1243,7 +1242,6 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page, ...@@ -1243,7 +1242,6 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page,
return -EINVAL; return -EINVAL;
if ((size + skb->len > mtu) && if ((size + skb->len > mtu) &&
(skb_queue_len(&sk->sk_write_queue) == 1) &&
(sk->sk_protocol == IPPROTO_UDP) && (sk->sk_protocol == IPPROTO_UDP) &&
(rt->dst.dev->features & NETIF_F_UFO)) { (rt->dst.dev->features & NETIF_F_UFO)) {
if (skb->ip_summed != CHECKSUM_PARTIAL) if (skb->ip_summed != CHECKSUM_PARTIAL)
......
...@@ -1361,12 +1361,11 @@ static int __ip6_append_data(struct sock *sk, ...@@ -1361,12 +1361,11 @@ static int __ip6_append_data(struct sock *sk,
*/ */
cork->length += length; cork->length += length;
if ((skb && skb_is_gso(skb)) || if ((((length + (skb ? skb->len : headersize)) > mtu) ||
(((length + (skb ? skb->len : headersize)) > mtu) && (skb && skb_is_gso(skb))) &&
(skb_queue_len(queue) <= 1) &&
(sk->sk_protocol == IPPROTO_UDP) && (sk->sk_protocol == IPPROTO_UDP) &&
(rt->dst.dev->features & NETIF_F_UFO) && !dst_xfrm(&rt->dst) && (rt->dst.dev->features & NETIF_F_UFO) && !dst_xfrm(&rt->dst) &&
(sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk))) { (sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk)) {
err = ip6_ufo_append_data(sk, queue, getfrag, from, length, err = ip6_ufo_append_data(sk, queue, getfrag, from, length,
hh_len, fragheaderlen, exthdrlen, hh_len, fragheaderlen, exthdrlen,
transhdrlen, mtu, flags, fl6); transhdrlen, mtu, flags, fl6);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment