ubifs: Fix races between xattr_{set|get} and listxattr operations
mainline inclusion from mainline-v5.14 commit f4e3634a category: bugfix bugzilla: 173879 https://gitee.com/openeuler/kernel/issues/I4DDEL Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f4e3634a3b642225a530c292fdb1e8a4007507f5 --------------------------- UBIFS may occur some problems with concurrent xattr_{set|get} and listxattr operations, such as assertion failure, memory corruption, stale xattr value[1]. Fix it by importing a new rw-lock in @ubifs_inode to serilize write operations on xattr, concurrent read operations are still effective, just like ext4. [1] https://lore.kernel.org/linux-mtd/20200630130438.141649-1-houtao1@huawei.com Fixes: 1e51764a ("UBIFS: add new flash file system") Cc: stable@vger.kernel.org # v2.6+ Signed-off-by: NZhihao Cheng <chengzhihao1@huawei.com> Reviewed-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NRichard Weinberger <richard@nod.at> Reviewed-by: NZhang Yi <yi.zhang@huawei.com> Signed-off-by: NChen Jun <chenjun102@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录