Since it's implicitly supported since the initial EROFS kernel version.
It is particularly useful as an on-disk inode xattr placeholder for
on-disk core inode in-place updates, especially for root inodes because
"root_nid" recorded in the on-disk superblock is limited to 16 bits
for now.
Fixes: 1e429b74bff8 ("erofs-utils: lib: fix potential out-of-bound in xattr_entrylist()")
Reviewed-by: Sandeep Dhavale <dhavale@google.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240729075027.712339-1-hsiangkao@linux.alibaba.com
base_index = pf->prefix->base_index;
}
- if (base_index >= ARRAY_SIZE(xattr_types))
+ if (!base_index || base_index >= ARRAY_SIZE(xattr_types))
return 1;
prefix = xattr_types[base_index].prefix;
prefix_len = xattr_types[base_index].prefix_len;