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>] [day] [month] [year] [list]
Date:	Tue, 3 Mar 2015 07:40:17 +0100
From:	Michal Kazior <michal.kazior@...to.com>
To:	Nicholas Krause <xerofoify@...il.com>
Cc:	Kalle Valo <kvalo@....qualcomm.com>,
	Network Development <netdev@...r.kernel.org>,
	linux-wireless <linux-wireless@...r.kernel.org>,
	linux-kernel@...r.kernel.org,
	"ath10k@...ts.infradead.org" <ath10k@...ts.infradead.org>
Subject: Re: [PATCH] ath:Release resources for structure pointer, ar if error
 pointing device in the function, ath10k_core_register_work

On 3 March 2015 at 03:36, Nicholas Krause <xerofoify@...il.com> wrote:
> Releases resources and deregisters the stucture pointer ar passed by the caller to the function, ath10k_core_register_work
> if unable to probe the structure pointer successfully with a call to ath10k_core_probe_fw. Further more if this happerns
> we must first jump to the label err for the goto statement required to jump to handle this particular error in the function,
> ath10k_core_register_work.  After we are in the correct error section we must free the resources for the structure pointer,ar
> with a call to the function,  ath10k_core_unregister to free resources allocated for the structure pointer,ar.
>
> Signed-off-by: Nicholas Krause <xerofoify@...il.com>
> ---
>  drivers/net/wireless/ath/ath10k/core.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index 310e12b..8b2ca25 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -1307,9 +1307,7 @@ err_unregister_mac:
>  err_release_fw:
>         ath10k_core_free_firmware_files(ar);
>  err:
> -       /* TODO: It's probably a good idea to release device from the driver
> -        * but calling device_release_driver() here will cause a deadlock.
> -        */
> +       ath10k_core_unregister(ar);
>         return;
>  }

Did you test this? This will deadlock. ath10k_core_unregister() tries
to cancel ar->register_work. This won't work if you call it from the
worker itself. Moreover if I ignore the deadlock
ath10k_core_unregister() would do nothing else in this context because
ATH10K_FLAG_CORE_REGISTERED wouldn't be even set.

If you're interested in dealing with this TODO I suggest you read
through the original thread which led to the current state of affairs:

  http://www.spinics.net/lists/linux-wireless/msg124004.html


MichaƂ
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ