netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Hurley <john.hurley@netronome.com>
To: Simon Horman <simon.horman@netronome.com>
Cc: Davide Caratti <dcaratti@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCH net 2/2] net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions
Date: Fri, 11 Oct 2019 10:26:44 +0100	[thread overview]
Message-ID: <CAK+XE=mkg0=bX0pHuz9mVk1LbzmGqyN75hEhoNTZKtTyYfQFdw@mail.gmail.com> (raw)
In-Reply-To: <20191011073437.uwtftvhofrrm5r5v@netronome.com>

On Fri, Oct 11, 2019 at 8:34 AM Simon Horman <simon.horman@netronome.com> wrote:
>
> On Thu, Oct 10, 2019 at 08:43:53PM +0200, Davide Caratti wrote:
> > the following script:
> >
> >  # tc qdisc add dev eth0 clsact
> >  # tc filter add dev eth0 egress protocol ip matchall \
> >  > action mpls push protocol mpls_uc label 0x355aa bos 1
> >
> > causes corruption of all IP packets transmitted by eth0. On TC egress, we
> > can't rely on the value of skb->mac_len, because it's 0 and a MPLS 'push'
> > operation will result in an overwrite of the first 4 octets in the packet
> > L2 header (e.g. the Destination Address if eth0 is an Ethernet); the same
> > error pattern is present also in the MPLS 'pop' operation. Fix this error
> > in act_mpls data plane, computing 'mac_len' as the difference between the
> > network header and the mac header (when not at TC ingress), and use it in
> > MPLS 'push'/'pop' core functions.
> >
> > CC: Lorenzo Bianconi <lorenzo@kernel.org>
> > Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")
> > Signed-off-by: Davide Caratti <dcaratti@redhat.com>
>

Acked-by: John Hurley <john.hurley@netronome.com>

> Reviewed-by: Simon Horman <simon.horman@netronome.com>
>

  parent reply	other threads:[~2019-10-11  9:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 18:43 [PATCH net 0/2] net/sched: fix wrong behavior of MPLS push/pop action Davide Caratti
2019-10-10 18:43 ` [PATCH net 1/2] net: avoid errors when trying to pop MLPS header on non-MPLS packets Davide Caratti
2019-10-11  7:34   ` Simon Horman
2019-10-11  9:26     ` John Hurley
2019-10-10 18:43 ` [PATCH net 2/2] net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions Davide Caratti
2019-10-11  7:34   ` Simon Horman
2019-10-11  9:26     ` John Hurley
2019-10-11  9:26     ` John Hurley [this message]
2019-10-12  3:17   ` kbuild test robot

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='CAK+XE=mkg0=bX0pHuz9mVk1LbzmGqyN75hEhoNTZKtTyYfQFdw@mail.gmail.com' \
    --to=john.hurley@netronome.com \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=lorenzo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=simon.horman@netronome.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).