Commit 01fac170 authored by Yu Kuai's avatar Yu Kuai
Browse files

fs: fix kabi kroken in struct offset_ctx

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: default avatarYu Kuai <yukuai3@huawei.com>
parent 4caf3bc6
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -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;
	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);