mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
nfsd: fix NULL dereference in nfsd_statfs()
The commit ebabe9a900
pass a struct path to vfs_statfs
introduced the struct path initialization, and this seems to trigger
an Oops on my machine.
fh_dentry field may be NULL and set later in fh_verify(), thus the
initialization of path must be after fh_verify().
Signed-off-by: Takashi Iwai <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
This commit is contained in:
parent
f632265d0f
commit
f6360efb83
1 changed files with 8 additions and 6 deletions
|
|
@ -2033,15 +2033,17 @@ out:
|
|||
__be32
|
||||
nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat, int access)
|
||||
{
|
||||
struct path path = {
|
||||
.mnt = fhp->fh_export->ex_path.mnt,
|
||||
.dentry = fhp->fh_dentry,
|
||||
};
|
||||
__be32 err;
|
||||
|
||||
err = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP | access);
|
||||
if (!err && vfs_statfs(&path, stat))
|
||||
err = nfserr_io;
|
||||
if (!err) {
|
||||
struct path path = {
|
||||
.mnt = fhp->fh_export->ex_path.mnt,
|
||||
.dentry = fhp->fh_dentry,
|
||||
};
|
||||
if (vfs_statfs(&path, stat))
|
||||
err = nfserr_io;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue