mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
fuse: limit nsec
commit 47912eaa061a6a81e4aa790591a1874c650733c0 upstream. Limit nanoseconds to 0..999999999. Fixes: d8a5ba45457e ("[PATCH] FUSE - core") Cc: <stable@vger.kernel.org> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ca63d5abf4
commit
f41d150364
@ -174,6 +174,12 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr,
|
||||
inode->i_uid = make_kuid(&init_user_ns, attr->uid);
|
||||
inode->i_gid = make_kgid(&init_user_ns, attr->gid);
|
||||
inode->i_blocks = attr->blocks;
|
||||
|
||||
/* Sanitize nsecs */
|
||||
attr->atimensec = min_t(u32, attr->atimensec, NSEC_PER_SEC - 1);
|
||||
attr->mtimensec = min_t(u32, attr->mtimensec, NSEC_PER_SEC - 1);
|
||||
attr->ctimensec = min_t(u32, attr->ctimensec, NSEC_PER_SEC - 1);
|
||||
|
||||
inode->i_atime.tv_sec = attr->atime;
|
||||
inode->i_atime.tv_nsec = attr->atimensec;
|
||||
/* mtime from server may be stale due to local buffered write */
|
||||
|
Loading…
x
Reference in New Issue
Block a user