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: <20130726095347.GA2970@radagast>
Date:	Fri, 26 Jul 2013 12:53:47 +0300
From:	Felipe Balbi <balbi@...com>
To:	"Ivan T. Ivanov" <iivanov@...sol.com>
CC:	Paul Zimmerman <Paul.Zimmerman@...opsys.com>,
	"balbi@...com" <balbi@...com>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: dwc3: core: modify IO memory resource after
 deferred probe completes

Hi,

On Fri, Jul 26, 2013 at 09:48:26AM +0300, Ivan T. Ivanov wrote:
> > > Also, this is not *modifying* what was passed, just skipping the xHCI
> > > address space so we don't request_mem_region() an area we won't really
> > > handle and prevent xhci-hcd.ko from probing.
> > 
> > Hmm? platform_get_resource() returns a pointer to an entry in the
> > platform_device's resource[] array. And "res->start +=" modifies the
> > entry pointed at. If it didn't, the bug fixed by this patch wouldn't
> > have happened.
> > 
> > Are you sure this code will work OK if you build the driver as a module,
> > modprobe it, rmmod it, and then modprobe it again? Seems like it won't,
> > unless the dev->resource[] array gets reinitialized in between somehow.

gotta try that one... Perhaps the correct way would be to copy the
resource to a private struct resource and modify that one, leaving
pdev->resources untouched.

> In addition, I think driver is wasting memory, because on every probe
> it will reallocate driver state variable. This also happens in several 
> other drivers which are using deferred probe.

We can't do much about this since we're using devm_* API. Perhaps
deferred probe should make sure to destroy the device and add it back
later ? Otherwise what's the benefit of using devm_* ?

-- 
balbi

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ