netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Alexey Kodanev <alexey.kodanev@oracle.com>
Cc: <netdev@vger.kernel.org>, <vasily.isaenko@oracle.com>
Subject: Re: [PATCH] net/xfrm_input: fix possible NULL deref of tunnel.ip6->parms.i_key
Date: Fri, 12 Aug 2016 09:16:56 +0200	[thread overview]
Message-ID: <20160812071656.GH5710@gauss.secunet.com> (raw)
In-Reply-To: <1470826497-3931-1-git-send-email-alexey.kodanev@oracle.com>

On Wed, Aug 10, 2016 at 01:54:57PM +0300, Alexey Kodanev wrote:
> Running LTP 'icmp-uni-basic.sh -6 -p ipcomp -m tunnel' test over
> openvswitch + veth can trigger kernel panic:
> 
>   BUG: unable to handle kernel NULL pointer dereference
>   at 00000000000000e0 IP: [<ffffffff8169d1d2>] xfrm_input+0x82/0x750
>   ...
>   [<ffffffff816d472e>] xfrm6_rcv_spi+0x1e/0x20
>   [<ffffffffa082c3c2>] xfrm6_tunnel_rcv+0x42/0x50 [xfrm6_tunnel]
>   [<ffffffffa082727e>] tunnel6_rcv+0x3e/0x8c [tunnel6]
>   [<ffffffff8169f365>] ip6_input_finish+0xd5/0x430
>   [<ffffffff8169fc53>] ip6_input+0x33/0x90
>   [<ffffffff8169f1d5>] ip6_rcv_finish+0xa5/0xb0
>   ...
> 
> It seems that tunnel.ip6 can have garbage values and also dereferenced
> without a proper check, only tunnel.ip4 is being verified. Fix it by
> adding one more if block for AF_INET6 and initialize tunnel.ip6 with NULL
> inside xfrm6_rcv_spi() (which is similar to xfrm4_rcv_spi()).
> 
> Fixes: 049f8e2 ("xfrm: Override skb->mark with tunnel->parm.i_key in xfrm_input")
> 
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>

Applied to the ipsec tree, thanks a lot for the fix!

      reply	other threads:[~2016-08-12  7:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10 10:54 [PATCH] net/xfrm_input: fix possible NULL deref of tunnel.ip6->parms.i_key Alexey Kodanev
2016-08-12  7:16 ` Steffen Klassert [this message]

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=20160812071656.GH5710@gauss.secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=alexey.kodanev@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=vasily.isaenko@oracle.com \
    /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;
as well as URLs for NNTP newsgroup(s).