Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f435a5e authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Greg Kroah-Hartman
Browse files

fuse: verify nlink



commit c634da718db9b2fac201df2ae1b1b095344ce5eb upstream.

When adding a new hard link, make sure that i_nlink doesn't overflow.

Fixes: ac45d613 ("fuse: fix nlink after unlink")
Cc: <stable@vger.kernel.org> # v3.4
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 742f2319
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -837,6 +837,7 @@ static int fuse_link(struct dentry *entry, struct inode *newdir,

		spin_lock(&fc->lock);
		fi->attr_version = ++fc->attr_version;
		if (likely(inode->i_nlink < UINT_MAX))
			inc_nlink(inode);
		spin_unlock(&fc->lock);
		fuse_invalidate_attr(inode);