lkml.org 
[lkml]   [2018]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.15 103/202] nfsd: Detect unhashed stids in nfsd4_verify_open_stid()
    Date
    4.15-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Trond Myklebust <trond.myklebust@primarydata.com>

    commit 4f1764172a0aa7395d12b96cae640ca1438c5085 upstream.

    The state of the stid is guaranteed by 2 locks:
    - The nfs4_client 'cl_lock' spinlock
    - The nfs4_ol_stateid 'st_mutex' mutex

    so it is quite possible for the stid to be unhashed after lookup,
    but before calling nfsd4_lock_ol_stateid(). So we do need to check
    for a zero value for 'sc_type' in nfsd4_verify_open_stid().

    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Tested-by: Checuk Lever <chuck.lever@oracle.com>
    Fixes: 659aefb68eca "nfsd: Ensure we don't recognise lock stateids..."
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/nfsd/nfs4state.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/fs/nfsd/nfs4state.c
    +++ b/fs/nfsd/nfs4state.c
    @@ -3590,6 +3590,7 @@ nfsd4_verify_open_stid(struct nfs4_stid
    switch (s->sc_type) {
    default:
    break;
    + case 0:
    case NFS4_CLOSED_STID:
    case NFS4_CLOSED_DELEG_STID:
    ret = nfserr_bad_stateid;

    \
     
     \ /
      Last update: 2018-02-15 17:25    [W:4.078 / U:0.464 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site