netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Andrea Claudi <aclaudi@redhat.com>
Cc: netdev@vger.kernel.org, dsahern@gmail.com
Subject: Re: [PATCH iproute2] tc: fix segmentation fault on gact action
Date: Tue, 8 Oct 2019 20:20:25 -0700	[thread overview]
Message-ID: <20191008202025.3e5d749b@hermes.lan> (raw)
In-Reply-To: <b498237ee5b99e4687ba5068de09da91ef315235.1569924170.git.aclaudi@redhat.com>

On Tue,  1 Oct 2019 12:32:17 +0200
Andrea Claudi <aclaudi@redhat.com> wrote:

> tc segfaults if gact action is used without action or index:
> 
> $ ip link add type dummy
> $ tc actions add action pipe index 1
> $ tc filter add dev dummy0 parent ffff: protocol ip \
>   pref 10 u32 match ip src 127.0.0.2 flowid 1:10 action gact
> Segmentation fault
> 
> We expect tc to fail gracefully with an error message.
> 
> This happens if gact is the last argument of the incomplete
> command. In this case the "gact" action is parsed, the macro
> NEXT_ARG_FWD() is executed and the next matches() crashes
> because of null argv pointer.
> 
> To avoid this, simply use NEXT_ARG() instead.
> 
> With this change in place:
> 
> $ ip link add type dummy
> $ tc actions add action pipe index 1
> $ tc filter add dev dummy0 parent ffff: protocol ip \
>   pref 10 u32 match ip src 127.0.0.2 flowid 1:10 action gact
> Command line is not complete. Try option "help"
> 
> Fixes: fa4958897314 ("tc: Fix binding of gact action by index.")
> Reported-by: Davide Caratti <dcaratti@redhat.com>
> Signed-off-by: Andrea Claudi <aclaudi@redhat.com>

Thanks, applied

      reply	other threads:[~2019-10-09  3:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 10:32 [PATCH iproute2] tc: fix segmentation fault on gact action Andrea Claudi
2019-10-09  3:20 ` Stephen Hemminger [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=20191008202025.3e5d749b@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=aclaudi@redhat.com \
    --cc=dsahern@gmail.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).