From: Tang Yizhou tangyizhou@huawei.com
ascend inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4EUVI CVE: NA
-------------------------------------------------
When CONFIG_MEMCG is disabled an CONFIG_MM_OWNER is enabled, we encounter a compilation error as follows:
kernel/exit.c:399:6: error: redefinition of ‘mm_update_next_owner’ void mm_update_next_owner(struct mm_struct *mm) ^~~~~~~~~~~~~~~~~~~~ In file included from kernel/exit.c:10:0: ./include/linux/sched/mm.h:128:20: note: previous definition of ‘mm_update_next_owner’ was here static inline void mm_update_next_owner(struct mm_struct *mm)
To fix it, let mm_update_next_owner() depend on CONFIG_MM_OWNER
Fixes: 7560b5eec37c ("ascend: mm: add an owner for mm_struct") Signed-off-by: Tang Yizhou tangyizhou@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com Reviewed-by: Ding Tianhong dingtianhong@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com Reviewed-by: Weilong Chen chenweilong@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- include/linux/sched/mm.h | 4 ++-- mm/Kconfig | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h index ee7eada5b0164..bd762e7a2ec14 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -124,13 +124,13 @@ extern void exit_mm_release(struct task_struct *, struct mm_struct *); /* Remove the current tasks stale references to the old mm_struct on exec() */ extern void exec_mm_release(struct task_struct *, struct mm_struct *);
-#ifdef CONFIG_MEMCG +#ifdef CONFIG_MM_OWNER extern void mm_update_next_owner(struct mm_struct *mm); #else static inline void mm_update_next_owner(struct mm_struct *mm) { } -#endif /* CONFIG_MEMCG */ +#endif /* CONFIG_MM_OWNER */
#ifdef CONFIG_MMU extern void arch_pick_mmap_layout(struct mm_struct *mm, diff --git a/mm/Kconfig b/mm/Kconfig index 253fb184c8f8d..12601505c4a4a 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -302,7 +302,7 @@ config VIRT_TO_BUS config MM_OWNER bool "Enable the ownership the mm owner" help - This option enables mm_struct's to have an owner. + This option allows to record the canonical user of an mm struct
config MMU_NOTIFIER bool