From: Trond Myklebust Date: Fri, 17 Jun 2016 20:48:28 +0000 (-0400) Subject: NFS: Fix potential race in nfs_fhget() X-Git-Tag: v4.14-rc1~2956^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=916ec34d0bafe95b977908acd8b3153c9df6f9d6;p=platform%2Fkernel%2Flinux-rpi.git NFS: Fix potential race in nfs_fhget() If we don't set the mode correctly in nfs_init_locked(), then there is potential for a race with a second call to nfs_fhget that will cause inode aliasing. Signed-off-by: Trond Myklebust Reviewed-by: Jeff Layton Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 52e7d68..dda689d 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -282,6 +282,7 @@ nfs_init_locked(struct inode *inode, void *opaque) struct nfs_fattr *fattr = desc->fattr; set_nfs_fileid(inode, fattr->fileid); + inode->i_mode = fattr->mode; nfs_copy_fh(NFS_FH(inode), desc->fh); return 0; }