mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-20 14:16:02 +00:00
NFSv4: Fix an Oops in nfs4_do_setattr
commit09a54f0ebf
upstream. If the user specifies an open mode of 3, then we don't have a NFSv4 state attached to the context, and so we Oops when we try to dereference it. Reported-by: Olga Kornievskaia <aglo@umich.edu> Fixes:29b59f9416
("NFSv4: change nfs4_do_setattr to take...") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Cc: stable@vger.kernel.org # v4.10:991eedb137
: NFSv4: Only pass the... Cc: stable@vger.kernel.org # v4.10+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5a72bf90d7
commit
199e8a4385
1 changed files with 1 additions and 1 deletions
|
@ -2966,7 +2966,7 @@ static int _nfs4_do_setattr(struct inode *inode,
|
|||
|
||||
if (nfs4_copy_delegation_stateid(inode, FMODE_WRITE, &arg->stateid, &delegation_cred)) {
|
||||
/* Use that stateid */
|
||||
} else if (ctx != NULL) {
|
||||
} else if (ctx != NULL && ctx->state) {
|
||||
struct nfs_lock_context *l_ctx;
|
||||
if (!nfs4_valid_open_stateid(ctx->state))
|
||||
return -EBADF;
|
||||
|
|
Loading…
Reference in a new issue