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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200223103323.GD14067@amd>
Date:   Sun, 23 Feb 2020 11:33:23 +0100
From:   Pavel Machek <pavel@...x.de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Jia-Ju Bai <baijiaju1990@...il.com>,
        Felipe Balbi <balbi@...nel.org>,
        Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 032/191] usb: gadget: udc: fix possible
 sleep-in-atomic-context bugs in gr_probe()

Hi!

> From: Jia-Ju Bai <baijiaju1990@...il.com>
> 
> [ Upstream commit 9c1ed62ae0690dfe5d5e31d8f70e70a95cb48e52 ]
> 
> The driver may sleep while holding a spinlock.

True, but you can't just fix that by removing the locking.

> +++ b/drivers/usb/gadget/udc/gr_udc.c
> @@ -2180,8 +2180,6 @@ static int gr_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  	}
>  
> -	spin_lock(&dev->lock);
> -
>  	/* Inside lock so that no gadget can use this udc until probe is done */
>  	retval = usb_add_gadget_udc(dev->dev, &dev->gadget);
>  	if (retval) {

As this comment tries to explain. It is possible that the comment can
just be removed, but it looks like the code needs to be rearranged so
that rest of system does not see partly-initialized device.

Best regards,
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ