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: <20181004075914.GB20523@redhat.com>
Date:   Thu, 4 Oct 2018 09:59:15 +0200
From:   Stanislaw Gruszka <sgruszka@...hat.com>
To:     Jia-Ju Bai <baijiaju1990@...il.com>
Cc:     kvalo@...eaurora.org, davem@...emloft.net,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: wireless: iwlegacy: Fix possible data races in
 il4965_send_rxon_assoc()

On Wed, Oct 03, 2018 at 10:07:45PM +0800, Jia-Ju Bai wrote:
> These possible races are detected by a runtime testing. 
> To fix these races, the mutex lock is used in il4965_send_rxon_assoc() 
> to protect the data.

Really ? I'm surprised by that, see below.

> @@ -1297,6 +1297,7 @@ il4965_send_rxon_assoc(struct il_priv *il)
>  	const struct il_rxon_cmd *rxon1 = &il->staging;
>  	const struct il_rxon_cmd *rxon2 = &il->active;
>  
> +	mutex_lock(&il->mutex);
>  	if (rxon1->flags == rxon2->flags &&

For 4965 driver il4965_send_rxon_assoc() is only called by
il_mac_bss_info_changed() and il4965_commit_rxon().

il_mac_bss_info_changed() acquire il->mutex and
callers of  il4965_commit_rxon() acquire il->mutex
(but I did not check all of them).

So I wonder how this patch did not cause the deadlock ?
  
Anyway what can be done is adding:

lockdep_assert_held(&il->mutex);

il4965_commit_rxon() to check if we hold the mutex.

Thanks
Stanislaw

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ