Re: [Nfs-ganesha-devel] NULL pointer deref in clnt_ncreate_timed()

2018-01-23 Thread Daniel Gryniewicz

Hi, Pradeep.

Can you try with this patch on ntirpc?

https://github.com/nfs-ganesha/ntirpc/pull/105

Thanks,
Daniel

On 01/22/2018 08:08 PM, Pradeep wrote:

Hello,

I'm running into a crash in libntirpc with rc2:

#2  
#3  0x7f9004de31f4 in clnt_ncreate_timed (hostname=0x57592e 
"localhost", prog=100024, vers=1,
     netclass=0x57592a "tcp", tp=0x0) at 
/usr/src/debug/nfs-ganesha-2.6-rc2/libntirpc/src/clnt_generic.c:197
#4  0x0049a21c in clnt_ncreate (hostname=0x57592e "localhost", 
prog=100024, vers=1,
     nettype=0x57592a "tcp") at 
/usr/src/debug/nfs-ganesha-2.6-rc2/libntirpc/ntirpc/rpc/clnt.h:395
#5  0x0049a4d2 in nsm_connect () at 
/usr/src/debug/nfs-ganesha-2.6-rc2/Protocols/NLM/nsm.c:58
#6  0x0049c10d in nsm_unmonitor_all () at 
/usr/src/debug/nfs-ganesha-2.6-rc2/Protocols/NLM/nsm.c:267
#7  0x004449d4 in nfs_start (p_start_info=0x7c8b28 
)

     at /usr/src/debug/nfs-ganesha-2.6-rc2/MainNFSD/nfs_init.c:963
#8  0x0041cd2e in main (argc=10, argv=0x7fff68b294d8)
     at /usr/src/debug/nfs-ganesha-2.6-rc2/MainNFSD/nfs_main.c:499
(gdb) f 3
#3  0x7f9004de31f4 in clnt_ncreate_timed (hostname=0x57592e 
"localhost", prog=100024, vers=1,
     netclass=0x57592a "tcp", tp=0x0) at 
/usr/src/debug/nfs-ganesha-2.6-rc2/libntirpc/src/clnt_generic.c:197

197                     if (CLNT_SUCCESS(clnt))
(gdb) print clnt
$1 = (CLIENT *) 0x0

Looked at dev.22 and we were handling this error case correctly there.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot



___
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel




--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel


Re: [Nfs-ganesha-devel] NULL pointer deref in clnt_ncreate_timed()

2018-01-23 Thread William Allen Simpson

On 1/23/18 9:35 AM, William Allen Simpson wrote:

On 1/23/18 9:31 AM, Daniel Gryniewicz wrote:

On 01/23/2018 09:04 AM, William Allen Simpson wrote:

On 1/22/18 8:08 PM, Pradeep wrote:

Looked at dev.22 and we were handling this error case correctly there.


No, we're handling this error case correctly now.

Either you forgot to update your ntirpc, or there's a serious error in
ntirpc.  NULL should never be returned here.



Based on the backtrace, ntirpc is updated (ie, the line numbers all line up).   
There must be some way to return NULL here that we missed.


OK, should be obvious from the back trace.  I'll come by this afternoon
and we can track it down.


Needless to say, I cannot reproduce.

I'm guessing, and this is completely a WAG, that there's something weird
going on in __rpcb_findaddr_timed().  There are two places where it
calls getclnthandle(), and that can return NULL.  But we want to catch
any failures there, because that's a misconfiguration.

This is a recursive calling routine, called by clnt_tli_ncreate(), that
calls clnt_tli_ncreate() itself

So I guess we have to add some kind of error message indicating
misconfiguration, instead of crashing (or simply quitting as the old
PORTMAP code does).  This PORTMAP code is really terrible!

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel


Re: [Nfs-ganesha-devel] NULL pointer deref in clnt_ncreate_timed()

2018-01-23 Thread William Allen Simpson

On 1/23/18 9:31 AM, Daniel Gryniewicz wrote:

On 01/23/2018 09:04 AM, William Allen Simpson wrote:

On 1/22/18 8:08 PM, Pradeep wrote:

Looked at dev.22 and we were handling this error case correctly there.


No, we're handling this error case correctly now.

Either you forgot to update your ntirpc, or there's a serious error in
ntirpc.  NULL should never be returned here.



Based on the backtrace, ntirpc is updated (ie, the line numbers all line up).   
There must be some way to return NULL here that we missed.


OK, should be obvious from the back trace.  I'll come by this afternoon
and we can track it down.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel


Re: [Nfs-ganesha-devel] NULL pointer deref in clnt_ncreate_timed()

2018-01-23 Thread William Allen Simpson

On 1/22/18 8:08 PM, Pradeep wrote:

Hello,

I'm running into a crash in libntirpc with rc2:

#2  
#3  0x7f9004de31f4 in clnt_ncreate_timed (hostname=0x57592e "localhost", 
prog=100024, vers=1,
     netclass=0x57592a "tcp", tp=0x0) at 
/usr/src/debug/nfs-ganesha-2.6-rc2/libntirpc/src/clnt_generic.c:197
#4  0x0049a21c in clnt_ncreate (hostname=0x57592e "localhost", 
prog=100024, vers=1,
     nettype=0x57592a "tcp") at 
/usr/src/debug/nfs-ganesha-2.6-rc2/libntirpc/ntirpc/rpc/clnt.h:395
#5  0x0049a4d2 in nsm_connect () at 
/usr/src/debug/nfs-ganesha-2.6-rc2/Protocols/NLM/nsm.c:58
#6  0x0049c10d in nsm_unmonitor_all () at 
/usr/src/debug/nfs-ganesha-2.6-rc2/Protocols/NLM/nsm.c:267
#7  0x004449d4 in nfs_start (p_start_info=0x7c8b28 )
     at /usr/src/debug/nfs-ganesha-2.6-rc2/MainNFSD/nfs_init.c:963
#8  0x0041cd2e in main (argc=10, argv=0x7fff68b294d8)
     at /usr/src/debug/nfs-ganesha-2.6-rc2/MainNFSD/nfs_main.c:499
(gdb) f 3
#3  0x7f9004de31f4 in clnt_ncreate_timed (hostname=0x57592e "localhost", 
prog=100024, vers=1,
     netclass=0x57592a "tcp", tp=0x0) at 
/usr/src/debug/nfs-ganesha-2.6-rc2/libntirpc/src/clnt_generic.c:197
197                     if (CLNT_SUCCESS(clnt))
(gdb) print clnt
$1 = (CLIENT *) 0x0

Looked at dev.22 and we were handling this error case correctly there.


No, we're handling this error case correctly now.

Either you forgot to update your ntirpc, or there's a serious error in
ntirpc.  NULL should never be returned here.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel