Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbfc4b69 authored by David S. Miller's avatar David S. Miller
Browse files


Pablo Neira Ayuso says:

====================
The following patchset contains a late fix for IPVS:

* Fix crash when trying to remove the transport header with non-linear
  skbuffs, this was introduced in 3.6-rc. Patch from Peter Christensen
  via the IPVS folks.

I'll pass this to -stable once this hits mainstream.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 554215c5 f44a5f45
Loading
Loading
Loading
Loading
+10 −5
Original line number Original line Diff line number Diff line
@@ -1392,15 +1392,19 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned int hooknum)


	if (ipip) {
	if (ipip) {
		__be32 info = ic->un.gateway;
		__be32 info = ic->un.gateway;
		__u8 type = ic->type;
		__u8 code = ic->code;


		/* Update the MTU */
		/* Update the MTU */
		if (ic->type == ICMP_DEST_UNREACH &&
		if (ic->type == ICMP_DEST_UNREACH &&
		    ic->code == ICMP_FRAG_NEEDED) {
		    ic->code == ICMP_FRAG_NEEDED) {
			struct ip_vs_dest *dest = cp->dest;
			struct ip_vs_dest *dest = cp->dest;
			u32 mtu = ntohs(ic->un.frag.mtu);
			u32 mtu = ntohs(ic->un.frag.mtu);
			__be16 frag_off = cih->frag_off;


			/* Strip outer IP and ICMP, go to IPIP header */
			/* Strip outer IP and ICMP, go to IPIP header */
			__skb_pull(skb, ihl + sizeof(_icmph));
			if (pskb_pull(skb, ihl + sizeof(_icmph)) == NULL)
				goto ignore_ipip;
			offset2 -= ihl + sizeof(_icmph);
			offset2 -= ihl + sizeof(_icmph);
			skb_reset_network_header(skb);
			skb_reset_network_header(skb);
			IP_VS_DBG(12, "ICMP for IPIP %pI4->%pI4: mtu=%u\n",
			IP_VS_DBG(12, "ICMP for IPIP %pI4->%pI4: mtu=%u\n",
@@ -1408,7 +1412,7 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned int hooknum)
			ipv4_update_pmtu(skb, dev_net(skb->dev),
			ipv4_update_pmtu(skb, dev_net(skb->dev),
					 mtu, 0, 0, 0, 0);
					 mtu, 0, 0, 0, 0);
			/* Client uses PMTUD? */
			/* Client uses PMTUD? */
			if (!(cih->frag_off & htons(IP_DF)))
			if (!(frag_off & htons(IP_DF)))
				goto ignore_ipip;
				goto ignore_ipip;
			/* Prefer the resulting PMTU */
			/* Prefer the resulting PMTU */
			if (dest) {
			if (dest) {
@@ -1427,12 +1431,13 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned int hooknum)
		/* Strip outer IP, ICMP and IPIP, go to IP header of
		/* Strip outer IP, ICMP and IPIP, go to IP header of
		 * original request.
		 * original request.
		 */
		 */
		__skb_pull(skb, offset2);
		if (pskb_pull(skb, offset2) == NULL)
			goto ignore_ipip;
		skb_reset_network_header(skb);
		skb_reset_network_header(skb);
		IP_VS_DBG(12, "Sending ICMP for %pI4->%pI4: t=%u, c=%u, i=%u\n",
		IP_VS_DBG(12, "Sending ICMP for %pI4->%pI4: t=%u, c=%u, i=%u\n",
			&ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr,
			&ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr,
			ic->type, ic->code, ntohl(info));
			type, code, ntohl(info));
		icmp_send(skb, ic->type, ic->code, info);
		icmp_send(skb, type, code, info);
		/* ICMP can be shorter but anyways, account it */
		/* ICMP can be shorter but anyways, account it */
		ip_vs_out_stats(cp, skb);
		ip_vs_out_stats(cp, skb);