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: <519E2BD4.9020906@ti.com>
Date:	Thu, 23 May 2013 17:46:44 +0300
From:	Roger Quadros <rogerq@...com>
To:	Alan Stern <stern@...land.harvard.edu>
CC:	<gregkh@...uxfoundation.org>, <balbi@...com>,
	<linux-usb@...r.kernel.org>, <linux-omap@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>,
	<devicetree-discuss@...ts.ozlabs.org>
Subject: Re: [PATCH 1/1] USB: ehci-omap: Reset dma_mask pointer on probe

On 05/23/2013 05:11 PM, Alan Stern wrote:
> On Thu, 23 May 2013, Roger Quadros wrote:
> 
>> Device tree probed devices don't get dma_mask set. Previously
>> we were setting the dma_mask pointer only if it was NULL.
>> However, the address of 'omap_ehci_dma_mask' would change
>> each time the module is unloaded and loaded back thus causing
>> the devices dma_mask pointer to be invalid on the next load.
>>
>> This will cause page faults if any driver tries to access the
>> old dma_mask pointer.
>>
>> Unconditionally re-setting the dma_mask pointer fixes this problem.
> 
>> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
>> index 3d1491b..b33e306 100644
>> --- a/drivers/usb/host/ehci-omap.c
>> +++ b/drivers/usb/host/ehci-omap.c
>> @@ -146,8 +146,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
>>  	 * Since shared usb code relies on it, set it here for now.
>>  	 * Once we have dma capability bindings this can go away.
>>  	 */
>> -	if (!pdev->dev.dma_mask)
>> -		pdev->dev.dma_mask = &omap_ehci_dma_mask;
>> +	pdev->dev.dma_mask = &omap_ehci_dma_mask;
> 
> Is this the solution that people have agreed on?  There has been a lot 
> of discussion on this topic.  In particular, there has been talk about 
> fixing it in the DT core.

Fixing it in DT core would be best.
> 
> This particular approach doesn't seem very robust.  What if 
> pdev->dev.dma_mask is already set to a different value for some good 
> reason?
> 

Then it breaks. But for OMAP, that situation seems unlikely.

cheers,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ