lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 21 Apr 2023 11:09:37 +0200
From:   Simon Horman <simon.horman@...igine.com>
To:     Pedro Tammela <pctammela@...atatu.com>
Cc:     Ivan Vecera <ivecera@...hat.com>, netdev@...r.kernel.org,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...nulli.us>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Marcelo Ricardo Leitner <marcelo.leitner@...il.com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net v2] net/sched: cls_api: Initialize miss_cookie_node
 when action miss is not used

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@...hat.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@...atatu.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ