Bug 1727248

Summary: [GNFS] showmout -a <IP> cause gnfs crash
Product: [Community] GlusterFS Reporter: Xie Changlong <xiechanglong>
Component: nfsAssignee: bugs <bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Manisha Saini <msaini>
Severity: high Docs Contact:
Priority: urgent    
Version: mainlineCC: atumball, bugs, pasik, rhs-bugs, sankarshan, storage-qa-internal, sunkumar
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-10 18:00:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Xie Changlong 2019-07-05 07:46:14 UTC
Description of problem:

showmout -a <IP> cause gnfs crash:

#0  0x00007febb92af207 in raise () from /lib64/libc.so.6
#1  0x00007febb92b08f8 in abort () from /lib64/libc.so.6
#2  0x00007febb92f1cc7 in __libc_message () from /lib64/libc.so.6
#3  0x00007febb92fbc16 in _int_malloc () from /lib64/libc.so.6
#4  0x00007febb92fe7dc in malloc () from /lib64/libc.so.6
#5  0x00007febb9390f87 in __vasprintf_chk () from /lib64/libc.so.6
#6  0x00007febbad161fc in vasprintf (__ap=0x7feba824e2b0, __fmt=0x7feba76309a0 "mount entry: dir: %s, host: %s", __ptr=0x7feba824e298) at /usr/include/bits/stdio2.h:210
#7  _gf_msg (domain=domain@entry=0x7feba762fc4a "nfs-mount", file=file@entry=0x7feba762fc41 "mount3.c", function=function@entry=0x7feba7631120 <__FUNCTION__.23648> "__build_mountlist", line=line@entry=2343,
    level=level@entry=GF_LOG_DEBUG, errnum=errnum@entry=0, trace=trace@entry=0, msgid=msgid@entry=0, fmt=fmt@entry=0x7feba76309a0 "mount entry: dir: %s, host: %s") at logging.c:1972
#8  0x00007feba75fd963 in __build_mountlist (ms=ms@entry=0x7feba802b530, count=count@entry=0x7feba824e488) at mount3.c:2342
#9  0x00007feba75fdb84 in mnt3svc_build_mountlist (ms=0x7feba802b530, count=count@entry=0x7feba824e488) at mount3.c:2371
#10 0x00007feba75fdc18 in mnt3svc_dump (req=0x7feba804d4a8) at mount3.c:2398
#11 0x00007febbad53da0 in synctask_wrap () at syncop.c:272
#12 0x00007febb92c0fc0 in ?? () from /lib64/libc.so.6
#13 0x0000000000000000 in ?? ()


Version-Release number of selected component (if applicable):

only test on master branch


How reproducible:

1. start gnfs
2. mount gnfs export directory
3. for i in $(seq 3333); do showmount -a 192.168.122.88; done
Then, nfs client will hung 

Steps to Reproduce:
1.
2.
3.

Actual results:

gnfs crash and nfs client will hung


Expected results:

no hung, gnfs works well.

Additional info:

Comment 2 Xie Changlong 2019-07-05 09:04:05 UTC
https://review.gluster.org/#/c/glusterfs/+/23002/

Comment 3 Xie Changlong 2019-07-05 09:04:11 UTC
https://review.gluster.org/#/c/glusterfs/+/23002/

Comment 4 Worker Ant 2019-07-05 12:11:48 UTC
REVIEW: https://review.gluster.org/23002 (gnfs: use strcpy to prevent memory overflow) posted (#1) for review on master by Xie Changlong

Comment 5 Worker Ant 2019-07-08 04:55:17 UTC
REVIEW: https://review.gluster.org/23002 (gnfs: use strcpy to prevent memory overflow) merged (#2) on master by jiffin tony Thottan

Comment 6 Worker Ant 2019-11-22 05:20:47 UTC
REVIEW: https://review.gluster.org/23737 (gnfs: use strcpy to prevent memory overflow) posted (#1) for review on release-7 by Amar Tumballi

Comment 7 Nithya Balachandran 2019-11-22 05:51:24 UTC
(In reply to Worker Ant from comment #6)
> REVIEW: https://review.gluster.org/23737 (gnfs: use strcpy to prevent memory
> overflow) posted (#1) for review on release-7 by Amar Tumballi

Please clone a bug for each release instead of using the mainline one.

Comment 8 Worker Ant 2019-11-22 06:03:16 UTC
REVISION POSTED: https://review.gluster.org/23737 (gnfs: use strcpy to prevent memory overflow) posted (#2) for review on release-7 by Amar Tumballi

Comment 9 Sunny Kumar 2020-02-10 18:00:08 UTC
Patch is merged closing this bug now.