]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
staging: erofs: fix race of initializing xattrs of a inode at the same time
authorGao Xiang <gaoxiang25@huawei.com>
Mon, 18 Feb 2019 07:19:04 +0000 (15:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Mar 2019 06:10:09 +0000 (07:10 +0100)
commit84f6c9bb3f21deaa9b98a2978aae96a89f4de4e3
treeb2d0726066f959239cf90e22329155a2a0c0d65a
parente06bb31e0fe4c6fc11693350c2db88ed4e87ae71
staging: erofs: fix race of initializing xattrs of a inode at the same time

commit 62dc45979f3f8cb0ea67302a93bff686f0c46c5a upstream.

In real scenario, there could be several threads accessing xattrs
of the same xattr-uninitialized inode, and init_inode_xattrs()
almost at the same time.

That's actually an unexpected behavior, this patch closes the race.

Fixes: b17500a0fdba ("staging: erofs: introduce xattr & acl support")
Cc: <stable@vger.kernel.org> # 4.19+
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/internal.h
drivers/staging/erofs/xattr.c