[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fda205c8-9b68-3333-a790-6191a03e0b67@linux.dev>
Date: Fri, 15 Sep 2023 21:37:22 +0100
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Ma Ke <make_ruc2021@....com>, jhs@...atatu.com,
xiyou.wangcong@...il.com, jiri@...nulli.us, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: sched: drr: dont intepret cls results when asked to
drop
On 15/09/2023 15:20, Ma Ke wrote:
> If asked to drop a packet via TC_ACT_SHOT it is unsafe to
> assume that res.class contains a valid pointer.
>
> Signed-off-by: Ma Ke <make_ruc2021@....com>
> ---
> net/sched/sch_drr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c
> index 19901e77cd3b..a535dc3b0e05 100644
> --- a/net/sched/sch_drr.c
> +++ b/net/sched/sch_drr.c
> @@ -310,6 +310,8 @@ static struct drr_class *drr_classify(struct sk_buff *skb, struct Qdisc *sch,
> fl = rcu_dereference_bh(q->filter_list);
> result = tcf_classify(skb, NULL, fl, &res, false);
> if (result >= 0) {
> + if (result == TC_ACT_SHOT)
> + return NULL;
With CONFIG_NET_CLS_ACT undefined tcf_classify can only return
TC_ACT_UNSPEC and the if statement above is always false.
Do you have any real issue you are trying to fix?
> #ifdef CONFIG_NET_CLS_ACT
> switch (result) {
> case TC_ACT_QUEUED:
> @@ -317,8 +319,6 @@ static struct drr_class *drr_classify(struct sk_buff *skb, struct Qdisc *sch,
> case TC_ACT_TRAP:
> *qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN;
> fallthrough;
> - case TC_ACT_SHOT:
> - return NULL;
> }
> #endif
> cl = (struct drr_class *)res.class;
Powered by blists - more mailing lists