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:   Mon, 20 Jul 2020 17:03:25 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Shannon Nelson <snelson@...sando.io>
Cc:     netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH net 2/5] ionic: fix up filter locks and debug msgs

On Mon, 20 Jul 2020 16:00:14 -0700 Shannon Nelson wrote:
> Add in a couple of forgotten spinlocks and fix up some of
> the debug messages around filter management.

Aren't these independent changes?

> Fixes: c1e329ebec8d ("ionic: Add management of rx filters")
> Signed-off-by: Shannon Nelson <snelson@...sando.io>

> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
> index 80eeb7696e01..fb9d828812bd 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
> @@ -69,10 +69,12 @@ int ionic_rx_filters_init(struct ionic_lif *lif)
>  
>  	spin_lock_init(&lif->rx_filters.lock);
>  
> +	spin_lock_bh(&lif->rx_filters.lock);
>  	for (i = 0; i < IONIC_RX_FILTER_HLISTS; i++) {
>  		INIT_HLIST_HEAD(&lif->rx_filters.by_hash[i]);
>  		INIT_HLIST_HEAD(&lif->rx_filters.by_id[i]);
>  	}
> +	spin_unlock_bh(&lif->rx_filters.lock);
>  
>  	return 0;
>  }
> @@ -84,11 +86,13 @@ void ionic_rx_filters_deinit(struct ionic_lif *lif)
>  	struct hlist_node *tmp;
>  	unsigned int i;
>  
> +	spin_lock_bh(&lif->rx_filters.lock);
>  	for (i = 0; i < IONIC_RX_FILTER_HLISTS; i++) {
>  		head = &lif->rx_filters.by_id[i];
>  		hlist_for_each_entry_safe(f, tmp, head, by_id)
>  			ionic_rx_filter_free(lif, f);
>  	}
> +	spin_unlock_bh(&lif->rx_filters.lock);
>  }

Taking a lock around init/deinit is a little strange, is this fixing 
a possible issue or just for "completeness"? If the like head can be
modified before it's initialized or after its flushed - that's a more
serious problem to address..

Powered by blists - more mailing lists