You need to sign in or sign up before continuing.
提交 afa79666 编写于 作者: T Tan Xiaojun 提交者: Xie XiuQi

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: NTan Xiaojun <tanxiaojun@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 148a9c4f
...@@ -133,6 +133,13 @@ struct dma_map_ops { ...@@ -133,6 +133,13 @@ struct dma_map_ops {
#ifdef ARCH_HAS_DMA_GET_REQUIRED_MASK #ifdef ARCH_HAS_DMA_GET_REQUIRED_MASK
u64 (*get_required_mask)(struct device *dev); u64 (*get_required_mask)(struct device *dev);
#endif #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; extern const struct dma_map_ops dma_direct_ops;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/kabi.h>
#include <linux/mmdebug.h> #include <linux/mmdebug.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/bug.h> #include <linux/bug.h>
...@@ -450,6 +451,11 @@ struct vm_operations_struct { ...@@ -450,6 +451,11 @@ struct vm_operations_struct {
*/ */
struct page *(*find_special_page)(struct vm_area_struct *vma, struct page *(*find_special_page)(struct vm_area_struct *vma,
unsigned long addr); 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) static inline void vma_init(struct vm_area_struct *vma, struct mm_struct *mm)
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <linux/mm_types_task.h> #include <linux/mm_types_task.h>
#include <linux/kabi.h>
#include <linux/auxvec.h> #include <linux/auxvec.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
...@@ -323,6 +324,11 @@ struct vm_area_struct { ...@@ -323,6 +324,11 @@ struct vm_area_struct {
struct mempolicy *vm_policy; /* NUMA policy for the VMA */ struct mempolicy *vm_policy; /* NUMA policy for the VMA */
#endif #endif
struct vm_userfaultfd_ctx vm_userfaultfd_ctx; struct vm_userfaultfd_ctx vm_userfaultfd_ctx;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
} __randomize_layout; } __randomize_layout;
struct core_thread { struct core_thread {
...@@ -493,6 +499,15 @@ struct mm_struct { ...@@ -493,6 +499,15 @@ struct mm_struct {
#endif #endif
} __randomize_layout; } __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 * The mm_cpumask needs to be at the end of mm_struct, because it
* is dynamically sized based on nr_cpu_ids. * is dynamically sized based on nr_cpu_ids.
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#ifndef _LINUX_MMU_NOTIFIER_H #ifndef _LINUX_MMU_NOTIFIER_H
#define _LINUX_MMU_NOTIFIER_H #define _LINUX_MMU_NOTIFIER_H
#include <linux/kabi.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
...@@ -188,6 +189,11 @@ struct mmu_notifier_ops { ...@@ -188,6 +189,11 @@ struct mmu_notifier_ops {
*/ */
void (*invalidate_range)(struct mmu_notifier *mn, struct mm_struct *mm, void (*invalidate_range)(struct mmu_notifier *mn, struct mm_struct *mm,
unsigned long start, unsigned long end); 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 { ...@@ -204,6 +210,9 @@ struct mmu_notifier_ops {
struct mmu_notifier { struct mmu_notifier {
struct hlist_node hlist; struct hlist_node hlist;
const struct mmu_notifier_ops *ops; const struct mmu_notifier_ops *ops;
KABI_RESERVE(1)
KABI_RESERVE(2)
}; };
static inline int mm_has_notifiers(struct mm_struct *mm) static inline int mm_has_notifiers(struct mm_struct *mm)
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#ifndef __GENERATING_BOUNDS_H #ifndef __GENERATING_BOUNDS_H
#include <linux/kabi.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/wait.h> #include <linux/wait.h>
...@@ -506,6 +507,9 @@ struct zone { ...@@ -506,6 +507,9 @@ struct zone {
/* Zone statistics */ /* Zone statistics */
atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
atomic_long_t vm_numa_stat[NR_VM_NUMA_STAT_ITEMS]; atomic_long_t vm_numa_stat[NR_VM_NUMA_STAT_ITEMS];
KABI_RESERVE(1)
KABI_RESERVE(2)
} ____cacheline_internodealigned_in_smp; } ____cacheline_internodealigned_in_smp;
enum pgdat_flags { enum pgdat_flags {
...@@ -712,6 +716,9 @@ typedef struct pglist_data { ...@@ -712,6 +716,9 @@ typedef struct pglist_data {
/* Per-node vmstats */ /* Per-node vmstats */
struct per_cpu_nodestat __percpu *per_cpu_nodestats; struct per_cpu_nodestat __percpu *per_cpu_nodestats;
atomic_long_t vm_stat[NR_VM_NODE_STAT_ITEMS]; atomic_long_t vm_stat[NR_VM_NODE_STAT_ITEMS];
KABI_RESERVE(1)
KABI_RESERVE(2)
} pg_data_t; } pg_data_t;
#define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages) #define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册