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:	Tue, 12 Apr 2016 17:26:41 +0530
From:	Sudip Mukherjee <sudipm.mukherjee@...il.com>
To:	Arend van Spriel <arend.vanspriel@...adcom.com>,
	Amitkumar Karwar <akarwar@...vell.com>,
	Nishant Sarmukadam <nishants@...vell.com>,
	Kalle Valo <kvalo@...eaurora.org>
CC:	linux-kernel@...r.kernel.org, linux-wireless@...r.kernel.org,
	netdev@...r.kernel.org,
	Sudip Mukherjee <sudip.mukherjee@...ethink.co.uk>,
	Christian Daudt <csd@...adcom.com>
Subject: Re: [PATCH v2] mwifiex: fix possible NULL dereference

On Tuesday 12 April 2016 05:20 PM, Arend van Spriel wrote:
>
>
> On 12-04-16 13:46, Sudip Mukherjee wrote:
>> From: Sudip Mukherjee <sudip.mukherjee@...ethink.co.uk>
>>
>> We have a check for card just after dereferencing it. So if it is NULL
>> we have already dereferenced it before its check. Lets dereference it
>> after checking card for NULL.
>
> And you are changing the scope of the pdev variable.

yes, and since all usage of pdev is inside the "if" block so it should 
not matter.

regards
sudip

>
> Regards,
> Arend
>
>> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@...ethink.co.uk>
>> ---
>>   drivers/net/wireless/marvell/mwifiex/pcie.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
>> index edf8b07..d4db9db 100644
>> --- a/drivers/net/wireless/marvell/mwifiex/pcie.c
>> +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
>> @@ -2884,10 +2884,11 @@ static void mwifiex_unregister_dev(struct mwifiex_adapter *adapter)
>>   {
>>   	struct pcie_service_card *card = adapter->card;
>>   	const struct mwifiex_pcie_card_reg *reg;
>> -	struct pci_dev *pdev = card->dev;
>>   	int i;
>>
>>   	if (card) {
>> +		struct pci_dev *pdev = card->dev;
>> +
>>   		if (card->msix_enable) {
>>   			for (i = 0; i < MWIFIEX_NUM_MSIX_VECTORS; i++)
>>   				synchronize_irq(card->msix_entries[i].vector);
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ