hulk inclusion category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAR5GW CVE: CVE-2024-46701
--------------------------------
The filed "struct xarray xa" is changed to "struct maple_tree mt", and the field 'next_offset' is changed from u32 to unsigned long.
Fixes: 0e4a862174f2 ("libfs: Convert simple directory offsets to use a Maple Tree") Signed-off-by: Yu Kuai yukuai3@huawei.com --- include/linux/fs.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4b3993b957e2..3cdb256a0d4c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -3256,8 +3256,17 @@ extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, const void __user *from, size_t count);
struct offset_ctx { - struct maple_tree mt; - unsigned long next_offset; + KABI_REPLACE(struct xarray xa, struct maple_tree mt) +#if BITS_PER_LONG == 32 + KABI_REPLACE(u32 next_offset, unsigned long next_offset) +#else +#ifdef __GENKSYMS__ + u32 next_offset; + /* 4 bytes hole */ +#else + unsigned long next_offset; +#endif +#endif };
void simple_offset_init(struct offset_ctx *octx);