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]
Message-ID: <CAM0EoMnO6m06r9vngnkCdOsMc8HYKh6i5xsWTfeHs+O=zBPFiQ@mail.gmail.com>
Date: Thu, 24 Aug 2023 10:57:19 -0400
From: Jamal Hadi Salim <jhs@...atatu.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Dan Carpenter <dan.carpenter@...aro.org>, Simon Horman <horms@...nel.org>, 
	Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: Weird sparse error WAS( [PATCH net-next v2 3/3] net/sched:
 act_blockcast: Introduce blockcast tc action

On Thu, Aug 24, 2023 at 10:41 AM Paolo Abeni <pabeni@...hat.com> wrote:
>
> On Thu, 2023-08-24 at 10:30 -0400, Jamal Hadi Salim wrote:
> > Dan/Simon,
> > Can someone help explain this error on the code below:
> >
> > ../net/sched/act_blockcast.c:213:9: warning: context imbalance in
> > 'tcf_blockcast_init' - different lock contexts for basic block
>
> IIRC sparse is fooled by lock under conditionals, in this case:
>
>        if (exists)
>                spin_lock_bh(&p->tcf_lock);
>
> a possible solution would be:
>
>         if (exists) {
>                 spin_lock_bh(&p->tcf_lock);
>                 goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
>                 spin_unlock_bh(&p->tcf_lock);
>         } else {
>                 goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
>         }
>

aha;->
Thanks - this should fix it. We will fix it to follow this pattern.

> Using some additional helpers the code could be less ugly...

I think only one other action(ife) has this pattern - we should be
able to fix that one instead.

cheers,
jamal


> Cheers,
>
> Paolo
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ