netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Davide Caratti <dcaratti@redhat.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net 1/4] net/sched: act_gact: disallow 'goto chain' on fallback control action
Date: Mon, 22 Oct 2018 22:55:54 +0200	[thread overview]
Message-ID: <20181022205554.GA2556@nanopsycho.orion> (raw)
In-Reply-To: <02f04ade8a0087781778d02fbb645b1d72f9d777.1540070509.git.dcaratti@redhat.com>

Sat, Oct 20, 2018 at 11:33:07PM CEST, dcaratti@redhat.com wrote:
>in the following command:
>
> # tc action add action <c1> random <rand_type> <c2> <rand_param>
>
>'goto chain x' is allowed only for c1: setting it for c2 makes the kernel
>crash with NULL pointer dereference, since TC core doesn't initialize the
>chain handle.
>
>Signed-off-by: Davide Caratti <dcaratti@redhat.com>
>---
> net/sched/act_gact.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
>index cd1d9bd32ef9..505138047e5c 100644
>--- a/net/sched/act_gact.c
>+++ b/net/sched/act_gact.c
>@@ -88,6 +88,11 @@ static int tcf_gact_init(struct net *net, struct nlattr *nla,
> 		p_parm = nla_data(tb[TCA_GACT_PROB]);
> 		if (p_parm->ptype >= MAX_RAND)
> 			return -EINVAL;
>+		if (TC_ACT_EXT_CMP(p_parm->paction, TC_ACT_GOTO_CHAIN)) {
>+			NL_SET_ERR_MSG(extack,
>+				       "goto chain not allowed on fallback");

No need for a line-wrap. Otherwise
Acked-by: Jiri Pirko <jiri@mellanox.com>

  parent reply	other threads:[~2018-10-23  5:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-20 21:33 [PATCH net 0/4] net/sched: forbid 'goto_chain' on fallback actions Davide Caratti
2018-10-20 21:33 ` [PATCH net 1/4] net/sched: act_gact: disallow 'goto chain' on fallback control action Davide Caratti
2018-10-22 16:22   ` Cong Wang
2018-10-22 20:55   ` Jiri Pirko [this message]
2018-10-20 21:33 ` [PATCH net 2/4] net/sched: act_police: " Davide Caratti
2018-10-22 16:23   ` Cong Wang
2018-10-22 20:57   ` Jiri Pirko
2018-10-20 21:33 ` [PATCH net 3/4] tc-tests: test denial of 'goto chain' on 'random' traffic in gact.json Davide Caratti
2018-10-20 21:33 ` [PATCH net 4/4] tc-tests: test denial of 'goto chain' for exceed traffic in police.json Davide Caratti
2018-10-22 18:39 ` [PATCH net 0/4] net/sched: forbid 'goto_chain' on fallback actions Jamal Hadi Salim
2018-10-23  2:43 ` 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=20181022205554.GA2556@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=jhs@mojatatu.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).