Flashes (Alerts)
Abstract
NFS-Ganesha shipped in IBM Spectrum Scale V5.0.4.0 to V5.0.4.3 may end up using freed memory leading to a crash or a hang while trying to re-use in-memory chunking data structure as part of executing a directory listing (NFS READDIR) request.
Content
Issue #1 :
While executing directory listing request, it may be possible that NFS-Ganesha cache has reached the high water mark limit for directory chunks and NFS-Ganesha may need to re-use an existing directory chunk. For re-using an existing directory chunk NFS-Ganesha calls function lru_reap_chunk_impl(), but at that time if another thread is freeing the same directory's handle, then NFS-Ganesha may end up using freed memory leading to a crash/hang.
Backtrace for the crash will be something like below (backtrace logged into /var/log/ganesha.log might have hex adresses as not all symbol mappings are available):
#0 0x00003fff955294a4 in .raise () from /lib64/libpthread.so.0
#1 0x000000001005b564 in crash_handler ()
#2 <signal handler called>
#3 0x00000000101cf5fc in mdcache_lru_clean ()
#4 0x00000000101d66ec in _mdcache_lru_unref ()
#5 0x00000000101cda88 in mdcache_put ()
#6 0x00000000101d0f3c in lru_reap_chunk_impl ()
#7 0x00000000101d1314 in mdcache_get_chunk ()
#8 0x00000000101f6c78 in mdcache_populate_dir_chunk ()
#1 0x000000001005b564 in crash_handler ()
#2 <signal handler called>
#3 0x00000000101cf5fc in mdcache_lru_clean ()
#4 0x00000000101d66ec in _mdcache_lru_unref ()
#5 0x00000000101cda88 in mdcache_put ()
#6 0x00000000101d0f3c in lru_reap_chunk_impl ()
#7 0x00000000101d1314 in mdcache_get_chunk ()
#8 0x00000000101f6c78 in mdcache_populate_dir_chunk ()
Issue #2 :
While executing directory listing request for a large directory, NFS-Ganesha fails to release a refcount on the current directory chunk while moving on to the next directory chunk. This leads to the current directory chunk not getting removed when its associated cached directory entry gets freed/invalidated. And thus the current directory chunk may point to a freed/invalidated directory entry. When we try to re-use such a directory chunk, we access the memory it points (freed/invalid memory) leading to a hang/crash.
Typical backtrace for the thread hanging in NFS-Ganesha process could have the following stack frames (need to run gstack or gdb against the NFS-Ganesha daemon process):
#0 0x00007f0e4b6b354d in __lll_lock_wait () from /lib64/libpthread.so.0
#1 0x00007f0e4b6b0667 in _L_lock_14 () from /lib64/libpthread.so.0
#2 0x00007f0e4b6b0613 in pthread_rwlock_trywrlock () from /lib64/libpthread.so.0
#3 0x00000000005427b5 in lru_reap_chunk_impl ()
#4 0x0000000000542c49 in mdcache_get_chunk ()
#5 0x000000000055d349 in mdcache_populate_dir_chunk ()
#1 0x00007f0e4b6b0667 in _L_lock_14 () from /lib64/libpthread.so.0
#2 0x00007f0e4b6b0613 in pthread_rwlock_trywrlock () from /lib64/libpthread.so.0
#3 0x00000000005427b5 in lru_reap_chunk_impl ()
#4 0x0000000000542c49 in mdcache_get_chunk ()
#5 0x000000000055d349 in mdcache_populate_dir_chunk ()
Users Affected:
NFS-Ganesha versions shipped with Spectrum Scale V5.0.4.0 to V5.0.4.3 are affected.
Recommendations:
Fix is available. Users running IBM Spectrum Scale V5.0.4.0 through V5.0.4.3 levels should apply IBM Spectrum Scale V5.0.4.4 or later.
If you cannot apply the above PTF level, contact IBM service to obtain and apply efix for your code level(s):
- For issue1 : IBM Spectrum Scale V5.0.4.0 through 5.0.4.3, reference APAR IJ24553
- For issue2: IBM Spectrum Scale V5.0.4.0 through 5.0.4.3, reference APAR IJ24721
To contact IBM Service, see http://www.ibm.com/planetwide/
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"STXKQY","label":"IBM Spectrum Scale"},"ARM Category":[{"code":"a8m50000000KzmkAAC","label":"Ganesha->Hang"}],"ARM Case Number":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"}],"Version":"5.0.4","Line of Business":{"code":"LOB26","label":"Storage"}}]
Was this topic helpful?
Document Information
Modified date:
13 May 2020
UID
ibm16207920