From: Yongqiang Liu liuyongqiang13@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4JWSP CVE: NA
--------------------------------------
Reserve space for the structure in memory subsystem.
Signed-off-by: Yongqiang Liu liuyongqiang13@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- include/linux/mm.h | 5 +++++ include/linux/mm_types.h | 15 +++++++++++++++ include/linux/mmu_notifier.h | 9 +++++++++ include/linux/mmzone.h | 9 +++++++++ include/linux/swap.h | 3 +++ 5 files changed, 41 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h index e2eb3ea63d6a..439e550f242c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -31,6 +31,7 @@ #include <linux/sizes.h> #include <linux/sched.h> #include <linux/pgtable.h> +#include <linux/kabi.h>
struct mempolicy; struct anon_vma; @@ -648,6 +649,10 @@ struct vm_operations_struct { */ struct page *(*find_special_page)(struct vm_area_struct *vma, unsigned long addr); + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
static inline void vma_init(struct vm_area_struct *vma, struct mm_struct *mm) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 30b36a3adb87..75a9235f7aa9 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -4,6 +4,7 @@
#include <linux/mm_types_task.h>
+#include <linux/kabi.h> #include <linux/auxvec.h> #include <linux/list.h> #include <linux/spinlock.h> @@ -374,6 +375,11 @@ struct vm_area_struct { struct mempolicy *vm_policy; /* NUMA policy for the VMA */ #endif struct vm_userfaultfd_ctx vm_userfaultfd_ctx; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) } __randomize_layout;
struct core_thread { @@ -581,6 +587,15 @@ struct mm_struct { #endif } __randomize_layout;
+ KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) + #if IS_ENABLED(CONFIG_KVM) && !defined(__GENKSYMS__) struct kvm *kvm; #endif diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 1a6a9eb6d3fa..857df3eea53f 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -8,6 +8,7 @@ #include <linux/mmap_lock.h> #include <linux/srcu.h> #include <linux/interval_tree.h> +#include <linux/kabi.h>
struct mmu_notifier_subscriptions; struct mmu_notifier; @@ -215,6 +216,11 @@ struct mmu_notifier_ops { */ struct mmu_notifier *(*alloc_notifier)(struct mm_struct *mm); void (*free_notifier)(struct mmu_notifier *subscription); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
/* @@ -234,6 +240,9 @@ struct mmu_notifier { struct mm_struct *mm; struct rcu_head rcu; unsigned int users; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
/** diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index d73b1486ffb8..21b1def88436 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -21,6 +21,7 @@ #include <linux/mm_types.h> #include <linux/page-flags.h> #include <asm/page.h> +#include <linux/kabi.h>
/* Free memory management - zoned buddy allocator. */ #ifndef CONFIG_FORCE_MAX_ZONEORDER @@ -583,6 +584,11 @@ struct zone { bool contiguous;
ZONE_PADDING(_pad3_) + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) /* Zone statistics */ atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; atomic_long_t vm_numa_stat[NR_VM_NUMA_STAT_ITEMS]; @@ -824,6 +830,9 @@ typedef struct pglist_data {
ZONE_PADDING(_pad2_)
+ KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) /* Per-node vmstats */ struct per_cpu_nodestat __percpu *per_cpu_nodestats; atomic_long_t vm_stat[NR_VM_NODE_STAT_ITEMS]; diff --git a/include/linux/swap.h b/include/linux/swap.h index 9b708c0288bc..f2aa72ec0e57 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -12,6 +12,7 @@ #include <linux/fs.h> #include <linux/atomic.h> #include <linux/page-flags.h> +#include <linux/kabi.h> #include <asm/page.h>
struct notifier_block; @@ -291,6 +292,8 @@ struct swap_info_struct { */ struct work_struct discard_work; /* discard worker */ struct swap_cluster_list discard_clusters; /* discard clusters list */ + KABI_RESERVE(1) + KABI_RESERVE(2) struct plist_node avail_lists[]; /* * entries in swap_avail_heads, one * entry per node.