From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Network Development <netdev@vger.kernel.org>,
syzbot <syzbot+4a2c52677a8a1aa283cb@syzkaller.appspotmail.com>,
William Tu <u9012063@gmail.com>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Subject: Re: [Patch net] ip_gre: set dev->hard_header_len properly
Date: Thu, 8 Oct 2020 16:19:10 -0400 [thread overview]
Message-ID: <CA+FuTSfcefUt5EkWEUh3FzDUiCuEcDSJ4KP0wu_U+B_btuecQA@mail.gmail.com> (raw)
In-Reply-To: <20201008012154.11149-1-xiyou.wangcong@gmail.com>
On Wed, Oct 7, 2020 at 9:22 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().
>
> Fix this by setting dev->hard_header_len whenever sets header_ops,
> as dev->hard_header_len is supposed to be the length of the header
> created by dev->header_ops->create() anyway.
>
> Reported-and-tested-by: syzbot+4a2c52677a8a1aa283cb@syzkaller.appspotmail.com
> Cc: William Tu <u9012063@gmail.com>
> Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Willem de Bruijn <willemb@google.com>
> The syzbot report has the information for both of your questions:
> https://syzkaller.appspot.com/text?tag=CrashReport&x=11845568500000
>
> It clearly shows packet_snd() and ipgre_xmit().
Thanks. I hadn't thought to check that (clearly).
prev parent reply other threads:[~2020-10-08 20:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 1:21 [Patch net] ip_gre: set dev->hard_header_len properly Cong Wang
2020-10-08 11:48 ` Willem de Bruijn
2020-10-08 17:33 ` Cong Wang
2020-10-08 19:04 ` Willem de Bruijn
2020-10-08 19:16 ` Xie He
2020-10-08 19:19 ` Willem de Bruijn
2020-10-08 20:10 ` Xie He
2020-10-08 20:31 ` Willem de Bruijn
2020-10-08 21:35 ` Xie He
2020-10-08 21:47 ` Willem de Bruijn
2020-10-08 21:54 ` Xie He
2020-10-08 23:40 ` Xie He
2020-10-09 17:43 ` Cong Wang
2020-10-09 19:41 ` Xie He
2020-10-09 19:51 ` Xie He
2020-10-09 20:38 ` Cong Wang
2020-10-10 1:07 ` Cong Wang
2020-10-10 3:10 ` Xie He
2020-10-10 18:58 ` Cong Wang
2020-10-10 21:49 ` Xie He
2020-10-11 3:55 ` Xie He
2020-10-11 14:35 ` Xie He
2020-10-08 19:18 ` Willem de Bruijn
2020-10-08 19:50 ` Cong Wang
2020-10-08 20:19 ` Willem de Bruijn [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=CA+FuTSfcefUt5EkWEUh3FzDUiCuEcDSJ4KP0wu_U+B_btuecQA@mail.gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=syzbot+4a2c52677a8a1aa283cb@syzkaller.appspotmail.com \
--cc=u9012063@gmail.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).