All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: <netdev@vger.kernel.org>, Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [Patch net] xfrm: check id proto in validate_tmpl()
Date: Wed, 29 Nov 2017 13:15:51 +0100	[thread overview]
Message-ID: <20171129121550.m2dyy5ahf66trkqz@gauss3.secunet.de> (raw)
In-Reply-To: <20171127191516.14336-1-xiyou.wangcong@gmail.com>

On Mon, Nov 27, 2017 at 11:15:16AM -0800, Cong Wang wrote:
> syzbot reported a kernel warning in xfrm_state_fini(), which
> indicates that we have entries left in the list
> net->xfrm.state_all whose proto is zero. And
> xfrm_id_proto_match() doesn't consider them as a match with
> IPSEC_PROTO_ANY in this case.
> 
> Proto with value 0 is probably not a valid value, at least
> verify_newsa_info() doesn't consider it valid either.
> 
> This patch fixes it by checking the proto value in
> validate_tmpl() and rejecting invalid ones, like what iproute2
> does in xfrm_xfrmproto_getbyname().
> 
> Reported-by: syzbot <syzkaller@googlegroups.com>
> Cc: Steffen Klassert <steffen.klassert@secunet.com>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Patch applied, thanks!

      reply	other threads:[~2017-11-29 12:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 19:15 [Patch net] xfrm: check id proto in validate_tmpl() Cong Wang
2017-11-29 12:15 ` 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=20171129121550.m2dyy5ahf66trkqz@gauss3.secunet.de \
    --to=steffen.klassert@secunet.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.