From afa796666a44acc78efe6519910e3d21dbde5215 Mon Sep 17 00:00:00 2001 From: Tan Xiaojun Date: Wed, 10 Apr 2019 18:34:51 +0800 Subject: [PATCH] kabi: reserve space for memory subsystem related structure hulk inclusion category: feature bugzilla: 13276 CVE: NA ------------------------------- Reserve space for the structure in memory subsystem. Signed-off-by: Tan Xiaojun Reviewed-by: Xie XiuQi Signed-off-by: Yang Yingliang --- include/linux/dma-mapping.h | 7 +++++++ include/linux/mm.h | 6 ++++++ include/linux/mm_types.h | 15 +++++++++++++++ include/linux/mmu_notifier.h | 9 +++++++++ include/linux/mmzone.h | 7 +++++++ 5 files changed, 44 insertions(+) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 1db6a6b46d0d..4ffc5d35c0da 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -133,6 +133,13 @@ struct dma_map_ops { #ifdef ARCH_HAS_DMA_GET_REQUIRED_MASK u64 (*get_required_mask)(struct device *dev); #endif + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) }; extern const struct dma_map_ops dma_direct_ops; diff --git a/include/linux/mm.h b/include/linux/mm.h index e899460f1bc5..3c39ce6db0c5 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -6,6 +6,7 @@ #ifdef __KERNEL__ +#include #include #include #include @@ -450,6 +451,11 @@ 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 5ed8f6292a53..6cc84cca66b3 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -4,6 +4,7 @@ #include +#include #include #include #include @@ -323,6 +324,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 { @@ -493,6 +499,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) + /* * The mm_cpumask needs to be at the end of mm_struct, because it * is dynamically sized based on nr_cpu_ids. diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 133ba78820ee..df4e70fa2efe 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -2,6 +2,7 @@ #ifndef _LINUX_MMU_NOTIFIER_H #define _LINUX_MMU_NOTIFIER_H +#include #include #include #include @@ -188,6 +189,11 @@ struct mmu_notifier_ops { */ void (*invalidate_range)(struct mmu_notifier *mn, struct mm_struct *mm, unsigned long start, unsigned long end); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; /* @@ -204,6 +210,9 @@ struct mmu_notifier_ops { struct mmu_notifier { struct hlist_node hlist; const struct mmu_notifier_ops *ops; + + KABI_RESERVE(1) + KABI_RESERVE(2) }; static inline int mm_has_notifiers(struct mm_struct *mm) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index d4b0c79d2924..e86b1fefa8fe 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -5,6 +5,7 @@ #ifndef __ASSEMBLY__ #ifndef __GENERATING_BOUNDS_H +#include #include #include #include @@ -506,6 +507,9 @@ struct zone { /* Zone statistics */ atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; atomic_long_t vm_numa_stat[NR_VM_NUMA_STAT_ITEMS]; + + KABI_RESERVE(1) + KABI_RESERVE(2) } ____cacheline_internodealigned_in_smp; enum pgdat_flags { @@ -712,6 +716,9 @@ typedef struct pglist_data { /* Per-node vmstats */ struct per_cpu_nodestat __percpu *per_cpu_nodestats; atomic_long_t vm_stat[NR_VM_NODE_STAT_ITEMS]; + + KABI_RESERVE(1) + KABI_RESERVE(2) } pg_data_t; #define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages) -- GitLab