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]
Date:	Thu, 02 Feb 2012 16:59:26 -0700
From:	Tim Gardner <rtg.canonical@...il.com>
To:	Larry Finger <Larry.Finger@...inger.net>
CC:	Tim Gardner <tim.gardner@...onical.com>,
	Chaoming Li <chaoming_li@...lsil.com.cn>,
	"John W. Linville" <linville@...driver.com>,
	linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rtlwifi: Fix PCI probe error path orphaned memory

On 02/02/2012 04:26 PM, Larry Finger wrote:
> On 02/02/2012 02:48 PM, Tim Gardner wrote:
>> Memory allocated by ieee80211_alloc_hw() will get orphaned
>> if any subsequent initializations fail.
>>
>> Also don't pci_set_drvdata(pdev, NULL) until just before disabling
>> the PCI device. Functions called by rtl_deinit_core(hw) may eventually
>> need
>> the context (when its actually implemented).
>>
>> Cc: Larry Finger<Larry.Finger@...inger.net>
>> Cc: Chaoming Li<chaoming_li@...lsil.com.cn>
>> Cc: John W. Linville<linville@...driver.com>
>> Cc: linux-wireless@...r.kernel.org
>> Cc: netdev@...r.kernel.org
>> Cc: linux-kernel@...r.kernel.org
>> Signed-off-by: Tim Gardner<tim.gardner@...onical.com>
>> ---
>> drivers/net/wireless/rtlwifi/pci.c | 19 ++++++++++++-------
>> 1 files changed, 12 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/wireless/rtlwifi/pci.c
>> b/drivers/net/wireless/rtlwifi/pci.c
>> index 5cb2199..6b18063 100644
>> --- a/drivers/net/wireless/rtlwifi/pci.c
>> +++ b/drivers/net/wireless/rtlwifi/pci.c
>> @@ -1760,8 +1760,8 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
>> if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
>> RT_ASSERT(false,
>> "Unable to obtain 32bit DMA for consistent allocations\n");
>> - pci_disable_device(pdev);
>> - return -ENOMEM;
>> + err = -ENOMEM;
>> + goto fail1;
>
> I would probably added a new label after the ieee80211_free_hw() and
> used it here to avoid the "if (hw)" test, but that is a matter of
> choice. In any case this patch is correct.
>
> ACKed-by: Larry Finger <Larry.Finger@...inger.net>
>
> Thanks,
>
> Larry
>

Actually, I started doing that but it turned into a huge patch, so I 
just decided to solved the immediate issue (discovered by inspection). 
There are some other setup/teardown nonorthogonalities that need fixing 
first (which I'm pursuing as time allows).

rtg
-- 
Tim Gardner tim.gardner@...onical.com
--
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