Netdev List
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Anarcheuz Fritz <anarcheuz@gmail.com>,
	davem@davemloft.net, security@kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-stable] ipv4: keep skb->dst around in presence of IP options
Date: Tue, 21 Mar 2017 11:25:29 +0000	[thread overview]
Message-ID: <1490095529.4770.12.camel@decadent.org.uk> (raw)
In-Reply-To: <1490070228.16816.98.camel@edumazet-glaptop3.roam.corp.google.com>

[-- Attachment #1: Type: text/plain, Size: 1448 bytes --]

On Mon, 2017-03-20 at 21:23 -0700, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> Upstream commit 34b2cef20f19c87999fff3da4071e66937db9644
> ("ipv4: keep skb->dst around in presence of IP options") incorrectly
> root caused commit d826eb14ecef ("ipv4: PKTINFO doesnt need dst
> reference") as bug origin.
> 
> This patch should fix the issue for 3.2.xx stable kernels, since IPv4
> options seem to get more traction these days, after years of oblivion
> ;)
> 
> Fixes: f84af32cbca70 ("net: ip_queue_rcv_skb() helper"))
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Anarcheuz Fritz <anarcheuz@gmail.com>
> ---
> 
> This is a backport for 3.2 kernels.

Added to the queue, thanks.

Ben.

> diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
> index b3648bbef0da..a6e1eeb02267 100644
> --- a/net/ipv4/ip_sockglue.c
> +++ b/net/ipv4/ip_sockglue.c
> @@ -1009,7 +1009,8 @@ e_inval:
>   */
>  int ip_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
>  {
> -	if (!(inet_sk(sk)->cmsg_flags & IP_CMSG_PKTINFO))
> +	if (!(inet_sk(sk)->cmsg_flags & IP_CMSG_PKTINFO) &&
> +	    !IPCB(skb)->opt.optlen)
>  		skb_dst_drop(skb);
>  	return sock_queue_rcv_skb(sk, skb);
>  }
> 
> 
-- 
Ben Hutchings
Power corrupts.  Absolute power is kind of neat.
                           - John Lehman, Secretary of the US Navy
1981-1987


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-03-21 11:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20  4:59 PROBLEM: null-ptr deref in ip_options_echo may lead to denial of service Anarcheuz Fritz
2017-03-20  5:25 ` Eric Dumazet
2017-03-21  0:33   ` Ben Hutchings
2017-03-21  0:36     ` Ben Hutchings
2017-03-21  4:23       ` [PATCH net-stable] ipv4: keep skb->dst around in presence of IP options Eric Dumazet
2017-03-21 11:25         ` Ben Hutchings [this message]
2017-03-21  4:24       ` PROBLEM: null-ptr deref in ip_options_echo may lead to denial of service Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490095529.4770.12.camel@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=anarcheuz@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=security@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox