netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xie He <xie.he.0141@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	syzbot <syzbot+4a2c52677a8a1aa283cb@syzkaller.appspotmail.com>,
	William Tu <u9012063@gmail.com>,
	Willem de Bruijn <willemb@google.com>
Subject: Re: [Patch net v3] ip_gre: set dev->hard_header_len and dev->needed_headroom properly
Date: Mon, 12 Oct 2020 18:56:32 -0700	[thread overview]
Message-ID: <CAJht_EPOjEACReo3M85TiKNquSPu92JWC3SfwsOr5PS7QDDqKw@mail.gmail.com> (raw)
In-Reply-To: <20201012231721.20374-1-xiyou.wangcong@gmail.com>

On Mon, Oct 12, 2020 at 4:17 PM Cong Wang <xiyou.wangcong@gmail.com> wrote:
>
> GRE tunnel has its own header_ops, ipgre_header_ops, and sets it
> conditionally. When it is set, it assumes the outer IP header is
> already created before ipgre_xmit().
>
> This is not true when we send packets through a raw packet socket,
> where L2 headers are supposed to be constructed by user. Packet
> socket calls dev_validate_header() to validate the header. But
> GRE tunnel does not set dev->hard_header_len, so that check can
> be simply bypassed, therefore uninit memory could be passed down
> to ipgre_xmit(). Similar for dev->needed_headroom.
>
> dev->hard_header_len is supposed to be the length of the header
> created by dev->header_ops->create(), so it should be used whenever
> header_ops is set, and dev->needed_headroom should be used when it
> is not set.

Acked-by: Xie He <xie.he.0141@gmail.com>

Thank you for your work, Cong!

  parent reply	other threads:[~2020-10-13  2:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12 23:17 [Patch net v3] ip_gre: set dev->hard_header_len and dev->needed_headroom properly Cong Wang
2020-10-13  1:46 ` Xie He
2020-10-13  1:56 ` Xie He [this message]
2020-10-14  1:38 ` Jakub Kicinski

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=CAJht_EPOjEACReo3M85TiKNquSPu92JWC3SfwsOr5PS7QDDqKw@mail.gmail.com \
    --to=xie.he.0141@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=syzbot+4a2c52677a8a1aa283cb@syzkaller.appspotmail.com \
    --cc=u9012063@gmail.com \
    --cc=willemb@google.com \
    --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 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).