netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: g.nault@alphalink.fr
Cc: netdev@vger.kernel.org, mostrows@earthlink.net,
	johannes@sipsolutions.net, lucien.xin@gmail.com
Subject: Re: [PATCH net] pppoe: take ->needed_headroom of lower device into account on xmit
Date: Tue, 23 Jan 2018 19:46:10 -0500 (EST)	[thread overview]
Message-ID: <20180123.194610.1683271824751989350.davem@davemloft.net> (raw)
In-Reply-To: <eea94e68f1285e08c5079555584e3656a498b9f3.1516640474.git.g.nault@alphalink.fr>

From: Guillaume Nault <g.nault@alphalink.fr>
Date: Mon, 22 Jan 2018 18:06:37 +0100

> In pppoe_sendmsg(), reserving dev->hard_header_len bytes of headroom
> was probably fine before the introduction of ->needed_headroom in
> commit f5184d267c1a ("net: Allow netdevices to specify needed head/tailroom").
> 
> But now, virtual devices typically advertise the size of their overhead
> in dev->needed_headroom, so we must also take it into account in
> skb_reserve().
> Allocation size of skb is also updated to take dev->needed_tailroom
> into account and replace the arbitrary 32 bytes with the real size of
> a PPPoE header.
> 
> This issue was discovered by syzbot, who connected a pppoe socket to a
> gre device which had dev->header_ops->create == ipgre_header and
> dev->hard_header_len == 0. Therefore, PPPoE didn't reserve any
> headroom, and dev_hard_header() crashed when ipgre_header() tried to
> prepend its header to skb->data.
 ...
> Admittedly PPPoE shouldn't be allowed to run on non Ethernet-like
> interfaces, but reserving space for ->needed_headroom is a more
> fundamental issue that needs to be addressed first.
> 
> Same problem exists for __pppoe_xmit(), which also needs to take
> dev->needed_headroom into account in skb_cow_head().
> 
> Fixes: f5184d267c1a ("net: Allow netdevices to specify needed head/tailroom")
> Reported-by: syzbot+ed0838d0fa4c4f2b528e20286e6dc63effc7c14d@syzkaller.appspotmail.com
> Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>

Applied, thanks Guillaume.

      parent reply	other threads:[~2018-01-24  0:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22 17:06 [PATCH net] pppoe: take ->needed_headroom of lower device into account on xmit Guillaume Nault
2018-01-23 10:14 ` Xin Long
2018-01-24  0:46 ` David Miller [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=20180123.194610.1683271824751989350.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=g.nault@alphalink.fr \
    --cc=johannes@sipsolutions.net \
    --cc=lucien.xin@gmail.com \
    --cc=mostrows@earthlink.net \
    --cc=netdev@vger.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;
as well as URLs for NNTP newsgroup(s).