From: Lu Jialin lujialin4@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4GII8?from=project-issue CVE: NA
--------
We reserve some fields beforehand for cgroup_bpf_attach_type and bpf_cgroup_storage_type prone to change, therefore, we can hot add/change features of bpf cgroup with this enhancement.
After reserving, normally cache does not matter as the reserved fields are not accessed at all.
Signed-off-by: Lu Jialin lujialin4@huawei.com Reviewed-by: weiyang wang wangweiyang2@huawei.com Reviewed-by: Wei Yongjun weiyongjun1@huawei.com Reviewed-by: Wei Yongjunweiyongjun1@huawei.com Reviewed-by: weiyang wang wangweiyang2@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- include/linux/bpf-cgroup.h | 8 ++++++++ include/linux/bpf.h | 8 ++++++++ 2 files changed, 16 insertions(+)
diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h index cd73f5cae523..bf74485b6567 100644 --- a/include/linux/bpf-cgroup.h +++ b/include/linux/bpf-cgroup.h @@ -49,6 +49,14 @@ enum cgroup_bpf_attach_type { CGROUP_INET4_GETSOCKNAME, CGROUP_INET6_GETSOCKNAME, CGROUP_INET_SOCK_RELEASE, + CGROUP_ATTACH_TYPE_KABI_RESERVE_1, + CGROUP_ATTACH_TYPE_KABI_RESERVE_2, + CGROUP_ATTACH_TYPE_KABI_RESERVE_3, + CGROUP_ATTACH_TYPE_KABI_RESERVE_4, + CGROUP_ATTACH_TYPE_KABI_RESERVE_5, + CGROUP_ATTACH_TYPE_KABI_RESERVE_6, + CGROUP_ATTACH_TYPE_KABI_RESERVE_7, + CGROUP_ATTACH_TYPE_KABI_RESERVE_8, MAX_CGROUP_BPF_ATTACH_TYPE };
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 88245386a4b6..0cbfdd423553 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -491,6 +491,14 @@ struct bpf_prog_offload { enum bpf_cgroup_storage_type { BPF_CGROUP_STORAGE_SHARED, BPF_CGROUP_STORAGE_PERCPU, + BPF_CGROUP_STORAGE_KABI_RESERVE_1, + BPF_CGROUP_STORAGE_KABI_RESERVE_2, + BPF_CGROUP_STORAGE_KABI_RESERVE_3, + BPF_CGROUP_STORAGE_KABI_RESERVE_4, + BPF_CGROUP_STORAGE_KABI_RESERVE_5, + BPF_CGROUP_STORAGE_KABI_RESERVE_6, + BPF_CGROUP_STORAGE_KABI_RESERVE_7, + BPF_CGROUP_STORAGE_KABI_RESERVE_8, __BPF_CGROUP_STORAGE_MAX };