提交 4f176417 编写于 作者: T Trond Myklebust 提交者: J. Bruce Fields

nfsd: Detect unhashed stids in nfsd4_verify_open_stid()

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: NTrond Myklebust <trond.myklebust@primarydata.com>
Tested-by: NChecuk Lever <chuck.lever@oracle.com>
Cc: stable@vger.kernel.org
Fixes: 659aefb6 "nfsd: Ensure we don't recognise lock stateids..."
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 d0945caa
......@@ -3590,6 +3590,7 @@ nfsd4_verify_open_stid(struct nfs4_stid *s)
switch (s->sc_type) {
default:
break;
case 0:
case NFS4_CLOSED_STID:
case NFS4_CLOSED_DELEG_STID:
ret = nfserr_bad_stateid;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册