netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Davide Caratti <dcaratti@redhat.com>
To: Guillaume Nault <gnault@redhat.com>,
	David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Martin Varghese <martin.varghese@nokia.com>
Subject: Re: [PATCH net] net/core: check length before updating Ethertype in skb_mpls_{push,pop}
Date: Sun, 04 Oct 2020 16:00:44 +0200	[thread overview]
Message-ID: <71bd92d07f21cbca5176e39774463b0ac135ad45.camel@redhat.com> (raw)
In-Reply-To: <71ec98d51cc4aab7615061336fb1498ad16cda30.1601667845.git.gnault@redhat.com>

On Fri, 2020-10-02 at 21:53 +0200, Guillaume Nault wrote:
> Openvswitch allows to drop a packet's Ethernet header, therefore
> skb_mpls_push() and skb_mpls_pop() might be called with ethernet=true
> and mac_len=0. In that case the pointer passed to skb_mod_eth_type()
> doesn't point to an Ethernet header and the new Ethertype is written at
> unexpected locations.
> 
> Fix this by verifying that mac_len is big enough to contain an Ethernet
> header.
> 
> Fixes: fa4e0f8855fc ("net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions")
> Signed-off-by: Guillaume Nault <gnault@redhat.com>
> ---
> Notes:
>   - Found by code inspection.
>   - Using commit fa4e0f8855fc for the Fixes tag because mac_len is
>     needed for the test. The problem probably exists since openvswitch
>     can pop the Ethernet header though.
> 
>  net/core/skbuff.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)


Acked-by: Davide Caratti <dcaratti@redhat.com>

thanks!

-- 
davide



  reply	other threads:[~2020-10-04 14:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 19:53 [PATCH net] net/core: check length before updating Ethertype in skb_mpls_{push,pop} Guillaume Nault
2020-10-04 14:00 ` Davide Caratti [this message]
2020-10-04 14:50 ` Varghese, Martin (Nokia - IN/Bangalore)
2020-10-04 21:29   ` David Miller
2020-10-04 22:10 ` David Miller

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=71bd92d07f21cbca5176e39774463b0ac135ad45.camel@redhat.com \
    --to=dcaratti@redhat.com \
    --cc=davem@davemloft.net \
    --cc=gnault@redhat.com \
    --cc=kuba@kernel.org \
    --cc=martin.varghese@nokia.com \
    --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).