1
0
Fork 0
alistair23-linux/fs/erofs
Gao Xiang 15f7b18691 erofs: fix extended inode could cross boundary
commit 0dcd3c94e0 upstream.

Each ondisk inode should be aligned with inode slot boundary
(32-byte alignment) because of nid calculation formula, so all
compact inodes (32 byte) cannot across page boundary. However,
extended inode is now 64-byte form, which can across page boundary
in principle if the location is specified on purpose, although
it's hard to be generated by mkfs due to the allocation policy
and rarely used by Android use case now mainly for > 4GiB files.

For now, only two fields `i_ctime_nsec` and `i_nlink' couldn't
be read from disk properly and cause out-of-bound memory read
with random value.

Let's fix now.

Fixes: 431339ba90 ("staging: erofs: add inode operations")
Cc: <stable@vger.kernel.org> # 4.19+
Link: https://lore.kernel.org/r/20200729175801.GA23973@xiangao.remote.csb
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-19 08:16:26 +02: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: fix out-of-bound read for shifted uncompressed block 2020-02-11 04:35:23 -08: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: fix extended inode could cross boundary 2020-08-19 08:16:26 +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: correct the remaining shrink objects 2020-04-17 10:50:16 +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: fix partially uninitialized misuse in z_erofs_onlinepage_fixup 2020-06-30 15:37:07 -04: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