All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Pedro Tammela <pctammela@mojatatu.com>
Cc: Ivan Vecera <ivecera@redhat.com>,
	netdev@vger.kernel.org, Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net v2] net/sched: cls_api: Initialize miss_cookie_node when action miss is not used
Date: Fri, 21 Apr 2023 11:09:37 +0200	[thread overview]
Message-ID: <ZEJS0YHW1Hv4+ni3@corigine.com> (raw)
In-Reply-To: <803f6502-76dc-d6e6-1bb2-5632de12e5ee@mojatatu.com>

On Thu, Apr 20, 2023 at 03:41:17PM -0300, Pedro Tammela wrote:
> On 20/04/2023 15:36, Ivan Vecera wrote:
> > Function tcf_exts_init_ex() sets exts->miss_cookie_node ptr only
> > when use_action_miss is true so it assumes in other case that
> > the field is set to NULL by the caller. If not then the field
> > contains garbage and subsequent tcf_exts_destroy() call results
> > in a crash.
> > Ensure that the field .miss_cookie_node pointer is NULL when
> > use_action_miss parameter is false to avoid this potential scenario.
> > 
> > Fixes: 80cd22c35c90 ("net/sched: cls_api: Support hardware miss to tc action")
> > Signed-off-by: Ivan Vecera <ivecera@redhat.com>
> > ---
> >   net/sched/cls_api.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> > index 35785a36c80298..3c3629c9e7b65c 100644
> > --- a/net/sched/cls_api.c
> > +++ b/net/sched/cls_api.c
> > @@ -3211,6 +3211,7 @@ int tcf_exts_init_ex(struct tcf_exts *exts, struct net *net, int action,
> >   #ifdef CONFIG_NET_CLS_ACT
> >   	exts->type = 0;
> >   	exts->nr_actions = 0;
> > +	exts->miss_cookie_node = NULL;
> >   	/* Note: we do not own yet a reference on net.
> >   	 * This reference might be taken later from tcf_exts_get_net().
> >   	 */
> 
> Reviewed-by: Pedro Tammela <pctammela@mojatatu.com>

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


  reply	other threads:[~2023-04-21  9:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 18:36 [PATCH net v2] net/sched: cls_api: Initialize miss_cookie_node when action miss is not used Ivan Vecera
2023-04-20 18:41 ` Pedro Tammela
2023-04-21  9:09   ` Simon Horman [this message]
2023-04-22  3:40 ` patchwork-bot+netdevbpf

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=ZEJS0YHW1Hv4+ni3@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ivecera@redhat.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pctammela@mojatatu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.