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] [day] [month] [year] [list]
Message-ID: <175CCF5F49938B4D99B2E3EF7F558EBE1A1857A496@SC-VEXCH4.marvell.com>
Date:	Thu, 5 Jul 2012 18:40:31 -0700
From:	Neil Zhang <zhangwm@...vell.com>
To:	Alexey Khoroshilov <khoroshilov@...ras.ru>,
	Felipe Balbi <balbi@...com>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"ldv-project@...ras.ru" <ldv-project@...ras.ru>
Subject: RE: [PATCH] usb: gadget: mv_udc: use GFP_ATOMIC in build_dtd()

Hi Alexey,
> -----Original Message-----
> From: Alexey Khoroshilov [mailto:khoroshilov@...ras.ru]
> Sent: 2012年7月6日 7:10
> To: Neil Zhang; Felipe Balbi
> Cc: Alexey Khoroshilov; Greg Kroah-Hartman; linux-usb@...r.kernel.org;
> linux-kernel@...r.kernel.org; ldv-project@...ras.ru
> Subject: [PATCH] usb: gadget: mv_udc: use GFP_ATOMIC in build_dtd()
> 
> build_dtd() is called either from interrupt handler mv_udc_irq()
> or with spinlock held (from mv_ep_queue()). So we should
> alloc memory with GFP_ATOMIC, not GFP_KERNEL.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov@...ras.ru>
> ---
>  drivers/usb/gadget/mv_udc_core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/mv_udc_core.c
> b/drivers/usb/gadget/mv_udc_core.c
> index 117a4bb..693e1e4 100644
> --- a/drivers/usb/gadget/mv_udc_core.c
> +++ b/drivers/usb/gadget/mv_udc_core.c
> @@ -374,7 +374,7 @@ static struct mv_dtd *build_dtd(struct mv_req *req,
> unsigned *length,
>  	 * Be careful that no _GFP_HIGHMEM is set,
>  	 * or we can not use dma_to_virt
>  	 */
> -	dtd = dma_pool_alloc(udc->dtd_pool, GFP_KERNEL, dma);
> +	dtd = dma_pool_alloc(udc->dtd_pool, GFP_ATOMIC, dma);
>  	if (dtd == NULL)
>  		return dtd;
> 
> --
> 1.7.9.5

Thanks for your finding.
Actually we have found the issue some months ago and I would like to add some error handler if it failed to alloc memory.
I will sent out the patches soon.
Thanks.

Best Regards,
Neil Zhang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ