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: <5B22410C.9080002@samsung.com>
Date:   Thu, 14 Jun 2018 19:18:52 +0900
From:   Chanwoo Choi <cw00.choi@...sung.com>
To:     linux-kernel@...r.kernel.org
Cc:     chanwoo@...nel.org, myungjoo.ham@...sung.com,
        stable@...r.kernel.org, Roger Quadros <rogerq@...com>,
        Kishon Vijay Abraham I <kishon@...com>,
        "H. Nikolaus Schaller" <hns@...delico.com>
Subject: Re: [PATCH] extcon: Release locking when sending the notification
 of connector state

+ H. Nikolaus Schaller <hns@...delico.com>

On 2018년 06월 14일 13:14, Chanwoo Choi wrote:
> Previously, extcon used the spinlock before calling the notifier_call_chain
> to prevent the scheduled out of task and to prevent the notification delay.
> When spinlock is locked for sending the notification, deadlock issue
> occured on the side of extcon consumer device. To fix this issue,
> extcon consumer device should always use the work. it is always not
> reasonable to use work.
> 
> To fix this issue on extcon consumer device, release locking when sending
> the notification of connector state.
> 
> Fixes: ab11af049f88 ("extcon: Add the synchronization extcon APIs to support the notification")
> Cc: stable@...r.kernel.org
> Cc: Roger Quadros <rogerq@...com>
> Cc: Kishon Vijay Abraham I <kishon@...com>
> Signed-off-by: Chanwoo Choi <cw00.choi@...sung.com>
> ---
>  drivers/extcon/extcon.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index 8bff5fd18185..f75b08a45d4e 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -433,8 +433,8 @@ int extcon_sync(struct extcon_dev *edev, unsigned int id)
>  		return index;
>  
>  	spin_lock_irqsave(&edev->lock, flags);
> -
>  	state = !!(edev->state & BIT(index));
> +	spin_unlock_irqrestore(&edev->lock, flags);
>  
>  	/*
>  	 * Call functions in a raw notifier chain for the specific one
> @@ -448,6 +448,7 @@ int extcon_sync(struct extcon_dev *edev, unsigned int id)
>  	 */
>  	raw_notifier_call_chain(&edev->nh_all, state, edev);
>  
> +	spin_lock_irqsave(&edev->lock, flags);
>  	/* This could be in interrupt handler */
>  	prop_buf = (char *)get_zeroed_page(GFP_ATOMIC);
>  	if (!prop_buf) {
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ