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: <5032627E.40009@parallels.com>
Date:	Mon, 20 Aug 2012 20:14:54 +0400
From:	Stanislav Kinsbursky <skinsbursky@...allels.com>
To:	"Myklebust, Trond" <Trond.Myklebust@...app.com>
CC:	"bfields@...ldses.org" <bfields@...ldses.org>,
	"linux-nfs@...r.kernel.org" <linux-nfs@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"devel@...nvz.org" <devel@...nvz.org>
Subject: Re: [PATCH] NFS: put net in case of idr allocation failure

20.08.2012 20:11, Myklebust, Trond пишет:
> On Mon, 2012-08-20 at 17:43 +0400, Stanislav Kinsbursky wrote:
>> Put net reference we got in nfs_alloc_client() on error path.
>>
>> Signed-off-by: Stanislav Kinsbursky <skinsbursky@...allels.com>
>> ---
>>   fs/nfs/nfs4client.c |    1 +
>>   1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
>> index cbcdfaf..b895629 100644
>> --- a/fs/nfs/nfs4client.c
>> +++ b/fs/nfs/nfs4client.c
>> @@ -74,6 +74,7 @@ struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init)
>>   	return clp;
>>
>>   error:
>> +	put_net(clp->cl_net);
>>   	kfree(clp);
>>   	return ERR_PTR(err);
>>   }
>
>
> No, that isn't anywhere near sufficient.
>
> The correct thing to do here is to replace the kfree with a call to
> nfs_free_client(), which will also clean up the allocation of
> cl_hostname, put the module, etc.
>

Sure, you are right.

-- 
Best regards,
Stanislav Kinsbursky
--
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