mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
fuse: verify nlink
commitc634da718d
upstream. When adding a new hard link, make sure that i_nlink doesn't overflow. Fixes:ac45d61357
("fuse: fix nlink after unlink") Cc: <stable@vger.kernel.org> # v3.4 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c294780a80
commit
2c48b0da2b
@ -830,7 +830,8 @@ static int fuse_link(struct dentry *entry, struct inode *newdir,
|
||||
|
||||
spin_lock(&fc->lock);
|
||||
fi->attr_version = ++fc->attr_version;
|
||||
inc_nlink(inode);
|
||||
if (likely(inode->i_nlink < UINT_MAX))
|
||||
inc_nlink(inode);
|
||||
spin_unlock(&fc->lock);
|
||||
fuse_invalidate_attr(inode);
|
||||
fuse_update_ctime(inode);
|
||||
|
Loading…
Reference in New Issue
Block a user