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: Tue, 6 Feb 2024 00:10:32 -0800
From: Michael Chan <michael.chan@...adcom.com>
To: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com, 
	kuba@...nel.org, pabeni@...hat.com, andrew.gospodarek@...adcom.com, 
	pavan.chebbi@...adcom.com
Subject: Re: [PATCH net-next 02/13] bnxt_en: Add ethtool -N support for ether filters.

On Mon, Feb 5, 2024 at 11:04 PM Michal Swiatkowski
<michal.swiatkowski@...ux.intel.com> wrote:
>
> On Mon, Feb 05, 2024 at 02:31:51PM -0800, Michael Chan wrote:
> > +     spin_lock_bh(&bp->ntp_fltr_lock);
> > +     fltr = __bnxt_lookup_l2_filter(bp, key, idx);
> > +     if (fltr) {
> > +             fltr = ERR_PTR(-EEXIST);
> > +             goto l2_filter_exit;
> > +     }
> > +     fltr = kzalloc(sizeof(*fltr), GFP_ATOMIC);
> > +     if (!fltr) {
> > +             fltr = ERR_PTR(-ENOMEM);
> > +             goto l2_filter_exit;
> > +     }
> > +     fltr->base.flags = flags;
> > +     rc = bnxt_init_l2_filter(bp, fltr, key, idx);
> > +     if (rc) {
> > +             spin_unlock_bh(&bp->ntp_fltr_lock);
> Why filter needs to be deleted without lock? If you can change the order
> it looks more natural:
>
> +if (rc) {
> +       fltr = ERR_PTR(rc);
> +       goto l2_filter_del;
> +}

Thanks for the review.  bnxt_del_l2_filter() will take the same lock
inside the function if it goes ahead to delete the filter.  That's why
the lock needs to be released first.

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ