1
0
Fork 0
alistair23-linux/fs/erofs
Gao Xiang a70bc7cc76 erofs: zero out when listxattr is called with no xattr
commit 926d165017 upstream.

As David reported [1], ENODATA returns when attempting
to modify files by using EROFS as an overlayfs lower layer.

The root cause is that listxattr could return unexpected
-ENODATA by mistake for inodes without xattr. That breaks
listxattr return value convention and it can cause copy
up failure when used with overlayfs.

Resolve by zeroing out if no xattr is found for listxattr.

[1] https://lore.kernel.org/r/CAEvUa7nxnby+rxK-KRMA46=exeOMApkDMAV08AjMkkPnTPV4CQ@mail.gmail.com
Link: https://lore.kernel.org/r/20191201084040.29275-1-hsiangkao@aol.com
Fixes: cadf1ccf1b ("staging: erofs: add error handling for xattr submodule")
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>
2019-12-17 19:56:23 +01:00
..
Kconfig erofs: kill all erofs specific fault injection 2019-09-05 20:10:08 +02:00
Makefile
compress.h
data.c erofs: fix erofs_get_meta_page locking due to a cleanup 2019-10-01 04:54:33 +08:00
decompressor.c erofs: rename errln/infoln/debugln to erofs_{err, info, dbg} 2019-09-05 20:10:09 +02:00
dir.c erofs: rename errln/infoln/debugln to erofs_{err, info, dbg} 2019-09-05 20:10:09 +02:00
erofs_fs.h erofs: update erofs_fs.h comments 2019-09-05 20:10:07 +02:00
inode.c erofs: always use iget5_locked 2019-09-05 20:10:09 +02:00
internal.h erofs: rename errln/infoln/debugln to erofs_{err, info, dbg} 2019-09-05 20:10:09 +02:00
namei.c erofs: rename errln/infoln/debugln to erofs_{err, info, dbg} 2019-09-05 20:10:09 +02:00
super.c erofs: fix return value check in erofs_read_superblock() 2019-10-01 04:53:50 +08:00
tagptr.h
utils.c erofs: remove all likely/unlikely annotations 2019-08-30 09:02:02 +02:00
xattr.c erofs: zero out when listxattr is called with no xattr 2019-12-17 19:56:23 +01:00
xattr.h erofs: use erofs_inode naming 2019-09-05 20:10:07 +02:00
zdata.c erofs: fix mis-inplace determination related with noio chain 2019-10-01 04:54:45 +08:00
zdata.h erofs: rename errln/infoln/debugln to erofs_{err, info, dbg} 2019-09-05 20:10:09 +02:00
zmap.c erofs: rename errln/infoln/debugln to erofs_{err, info, dbg} 2019-09-05 20:10:09 +02:00
zpvec.h erofs: remove all likely/unlikely annotations 2019-08-30 09:02:02 +02:00