Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYQOP CVE: CVE-2024-49861
--------------------------------
enum bpf_type_flag is used only in kernel. Let's fix this kabi breakage by adding KABI_BROKEN_INSERT_ENUM and KABI_BROKEN_INSERT_ENUM macro.
Fixes: 656830f06678 ("bpf: Add MEM_UNINIT as a bpf_type_flag") Fixes: 834a586818e5 ("bpf: Allow helpers to accept pointers with a fixed size") Fixes: ec15a06019fe ("bpf: Fix helper writes to read-only maps") Signed-off-by: Xiaomeng Zhang zhangxiaomeng13@huawei.com --- include/linux/bpf.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 4c169f0ff6ab..d709e32e841b 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -290,18 +290,19 @@ enum bpf_type_flag { */ MEM_ALLOC = BIT(2 + BPF_BASE_TYPE_BITS),
- MEM_UNINIT = BIT(7 + BPF_BASE_TYPE_BITS), + KABI_BROKEN_INSERT_ENUM(MEM_UNINIT = BIT(7 + BPF_BASE_TYPE_BITS))
/* Size is known at compile time. */ - MEM_FIXED_SIZE = BIT(10 + BPF_BASE_TYPE_BITS), + KABI_BROKEN_INSERT_ENUM(MEM_FIXED_SIZE = BIT(10 + BPF_BASE_TYPE_BITS))
/* Memory must be aligned on some architectures, used in combination with * MEM_FIXED_SIZE. */ - MEM_ALIGNED = BIT(17 + BPF_BASE_TYPE_BITS), + KABI_BROKEN_INSERT_ENUM(MEM_ALIGNED = BIT(17 + BPF_BASE_TYPE_BITS))
- __BPF_TYPE_FLAG_MAX, - __BPF_TYPE_LAST_FLAG = __BPF_TYPE_FLAG_MAX - 1, + KABI_BROKEN_INSERT_ENUM(__BPF_TYPE_FLAG_MAX) + KABI_BROKEN_REMOVE_ENUM(__BPF_TYPE_LAST_FLAG = MEM_ALLOC) + KABI_BROKEN_INSERT_ENUM(__BPF_TYPE_LAST_FLAG = __BPF_TYPE_FLAG_MAX - 1) };
/* Max number of base types. */