2008-04-22 14:23:14

by Chuck Lever

[permalink] [raw]
Subject: Re: [PATCH 31/33] NFS - fix potential NULL pointer dereference v2

On Apr 21, 2008, at 8:21 PM, Trond Myklebust wrote:
> On Mon, 2008-04-21 at 17:13 -0400, Chuck Lever wrote:
>> On Apr 19, 2008, at 4:40 PM, Trond Myklebust wrote:
>>> From: Cyrill Gorcunov <[email protected]>
>>>
>>> There is possible NULL pointer dereference if kstr[n]dup failed.
>>
>> The logic in super.c and client.c shouldn't assume
>> nfs_server.hostname
>> is non-NULL. Can you say where the NULL dereference might happen?
>
> Sure it does. See for instance all those dereferences of
> nfs_client->cl_hostname. It has never been acceptable to set a null
> hostname.

Whether or not cl_hostname is dereferenced, you need to fix
export_path too.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com


2008-04-22 15:12:25

by Myklebust, Trond

[permalink] [raw]
Subject: Re: [PATCH 31/33] NFS - fix potential NULL pointer dereference v2


On Tue, 2008-04-22 at 10:21 -0400, Chuck Lever wrote:
> On Apr 21, 2008, at 8:21 PM, Trond Myklebust wrote:
> > On Mon, 2008-04-21 at 17:13 -0400, Chuck Lever wrote:
> >> On Apr 19, 2008, at 4:40 PM, Trond Myklebust wrote:
> >>> From: Cyrill Gorcunov <[email protected]>
> >>>
> >>> There is possible NULL pointer dereference if kstr[n]dup failed.
> >>
> >> The logic in super.c and client.c shouldn't assume
> >> nfs_server.hostname
> >> is non-NULL. Can you say where the NULL dereference might happen?
> >
> > Sure it does. See for instance all those dereferences of
> > nfs_client->cl_hostname. It has never been acceptable to set a null
> > hostname.
>
> Whether or not cl_hostname is dereferenced, you need to fix
> export_path too.

<confused>Which the patch does. What is your point?</confused>

--
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
http://www.netapp.com