From: Davide Caratti <dcaratti@redhat.com>
To: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
gnault@redhat.com
Subject: Re: [PATCH net] net/sched: act_mpls: ensure LSE is pullable before reading it
Date: Wed, 18 Nov 2020 18:07:22 +0100 [thread overview]
Message-ID: <be2382dca0d817a4b5ac5b9820307ec82ce30c96.camel@redhat.com> (raw)
In-Reply-To: <20201118164719.GL3913@localhost.localdomain>
On Wed, 2020-11-18 at 13:47 -0300, Marcelo Ricardo Leitner wrote:
> On Wed, Nov 18, 2020 at 05:36:52PM +0100, Davide Caratti wrote:
>
> Hi,
>
> > case TCA_MPLS_ACT_MODIFY:
> > + if (!pskb_may_pull(skb,
> > + skb_network_offset(skb) + sizeof(new_lse)))
> > + goto drop;
> > new_lse = tcf_mpls_get_lse(mpls_hdr(skb), p, false);
> > if (skb_mpls_update_lse(skb, new_lse))
> > goto drop;
>
> Seems TCA_MPLS_ACT_DEC_TTL is also affected. skb_mpls_dec_ttl() will
> also call mpls_hdr(skb) without this check.
>
> Marcelo
>
... yes, correct; and at a first glance, also set_mpls() in
openvswitch/action.c has the same (theoretical) issue. I will follow-up
with other 2 patches, ok?
thanks!
--
davide
next prev parent reply other threads:[~2020-11-18 17:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-18 16:36 [PATCH net] net/sched: act_mpls: ensure LSE is pullable before reading it Davide Caratti
2020-11-18 16:47 ` Marcelo Ricardo Leitner
2020-11-18 17:07 ` Davide Caratti [this message]
2020-11-18 18:00 ` Marcelo Ricardo Leitner
2020-11-20 19:24 ` 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=be2382dca0d817a4b5ac5b9820307ec82ce30c96.camel@redhat.com \
--to=dcaratti@redhat.com \
--cc=gnault@redhat.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=marcelo.leitner@gmail.com \
--cc=netdev@vger.kernel.org \
--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).