diff options
author | Gao Xiang <[email protected]> | 2020-07-30 01:58:01 +0800 |
---|---|---|
committer | Gao Xiang <[email protected]> | 2020-08-03 21:04:46 +0800 |
commit | 0dcd3c94e02438f4a571690e26f4ee997524102a (patch) | |
tree | cdcedf2bdad9591b78c6eddfec85476a1c47629a /lib/test_overflow.c | |
parent | 592e7cd00bb9d48742ff402b74b79244e4a765dd (diff) |
erofs: fix extended inode could cross boundary
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: 431339ba9042 ("staging: erofs: add inode operations")
Cc: <[email protected]> # 4.19+
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Gao Xiang <[email protected]>
Diffstat (limited to 'lib/test_overflow.c')
0 files changed, 0 insertions, 0 deletions