Bug 1557445

Summary: [nfs-ganesha]: ensure correctness of RADOS OMAP kv fetched from RADOS
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Ram Raja <rraja>
Component: CephFSAssignee: Matt Benjamin (redhat) <mbenjamin>
Status: CLOSED ERRATA QA Contact: ceph-qe-bugs <ceph-qe-bugs>
Severity: medium Docs Contact: Aron Gunn <agunn>
Priority: medium    
Version: 3.0CC: agunn, ceph-eng-bugs, ceph-qe-bugs, jlayton, john.spray, kdreyer, mbenjamin, pdonnell, rperiyas, rraja, tbarron, tserlin, vakulkar
Target Milestone: z3Keywords: CodeChange
Target Release: 3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: RHEL: nfs-ganesha-2.5.5-5.el7cp Ubuntu: nfs-ganesha_2.5.5-8redhat1xenial Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-15 18:20:29 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 Ram Raja 2018-03-16 15:14:25 UTC
Description of problem:
NFS-Ganesha uses RADOS OMAP keyvalue interface to store NFS client recovery data. OSP 13 Manila setup relies on this feature of NFS-Ganesha to make sure NFS-Ganesha is highly available in active/passive configuration.

The following commit ensures the correctness when fetching data from OMAP key-value interface.

Author: Jeff Layton <jlayton>
Date:   Fri Mar 2 06:47:28 2018 -0500

    RADOS_KV: do copy in rados_kv_get before releasing read op
    
    Jason Dillaman pointed out that we're relying on these strings to
    remain valid after releasing the read op in rados_kv_get. That's not
    guaranteed to work.
    
    Change rados_kv_get to copy the string into the destination buffer
    before releasing the op.
    
    Change-Id: Ia11e10a7ca113876d8ba4f1a5fa2851fa683d1a8
    Reported-by: Jason Dillaman <jdillama>
    Signed-off-by: Jeff Layton <jlayton>

The patch is in upstream NFS-Ganesha v2.7-dev3
Need to backport to downstream NFS-Ganesha in RHCS

Version-Release number of selected component (if applicable):
NFS-Ganesha in RHCS 3.0.z1 and 3.0

It's not easy to write a reproducer for this issue. It's a safety/correctness issue.

Comment 4 Ram Raja 2018-03-16 15:16:29 UTC
Commit ID was missing.

commit 7695a6c24bec0de58fb287856747534bb0103d4e
Author: Jeff Layton <jlayton>
Date:   Fri Mar 2 06:47:28 2018 -0500

    RADOS_KV: do copy in rados_kv_get before releasing read op
    
    Jason Dillaman pointed out that we're relying on these strings to
    remain valid after releasing the read op in rados_kv_get. That's not
    guaranteed to work.
    
    Change rados_kv_get to copy the string into the destination buffer
    before releasing the op.
    
    Change-Id: Ia11e10a7ca113876d8ba4f1a5fa2851fa683d1a8
    Reported-by: Jason Dillaman <jdillama>
    Signed-off-by: Jeff Layton <jlayton>

https://github.com/nfs-ganesha/nfs-ganesha/commit/7695a6c24bec0de58fb287856747534bb0103d4e

Comment 22 errata-xmlrpc 2018-05-15 18:20:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1563