mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 13:22:57 +00:00
nfsd: fix use-after-free in nfsd_file_do_acquire tracepoint
[ Upstream commitbdd6b5624c
] When we fail to insert into the hashtable with a non-retryable error, we'll free the object and then goto out_status. If the tracepoint is enabled, it'll end up accessing the freed object when it tries to grab the fields out of it. Set nf to NULL after freeing it to avoid the issue. Fixes:243a526301
("nfsd: rework hashtable handling in nfsd_do_file_acquire") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
3ec2c9976c
commit
98d400fc2d
1 changed files with 1 additions and 0 deletions
|
@ -1075,6 +1075,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
|
|||
goto open_file;
|
||||
|
||||
nfsd_file_slab_free(&nf->nf_rcu);
|
||||
nf = NULL;
|
||||
if (ret == -EEXIST)
|
||||
goto retry;
|
||||
trace_nfsd_file_insert_err(rqstp, key.inode, may_flags, ret);
|
||||
|
|
Loading…
Reference in a new issue