提交 6d5d324d 编写于 作者: M Ma Wupeng 提交者: Yongqiang Liu

mm/rmap: Fix kabi broken in anon_vma

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I5USOP
CVE: CVE-2022-42703

--------------------------------

In order to fix CVE-2022-42703, degree in struct anon_vma is splited into
two variables(num_children, num_active_vmas) and this will lead to broken
kabi.

Since struct anon_vma is only used by mm module and referenced by other
struct as pointers. So we can ignore this kabi change warning.

For variable degree in struct anon_vma, previous patch has already
delete this but this will lead to kabi change. Add it back at the same
position. For variables(num_children, num_active_vmas), put them
between macro __GENKSYMS__.
Signed-off-by: NMa Wupeng <mawupeng1@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
上级 a3544c89
...@@ -38,16 +38,12 @@ struct anon_vma { ...@@ -38,16 +38,12 @@ struct anon_vma {
*/ */
atomic_t refcount; atomic_t refcount;
/* #ifndef __GENKSYMS__
* Count of child anon_vmas. Equals to the count of all anon_vmas that unsigned __unused_degree;
* have ->parent pointing to this one, including itself. #else
* /* Add degree back for KABI compatibility */
* This counter is used for making decision about reusing anon_vma unsigned degree;
* instead of forking new one. See comments in function anon_vma_clone. #endif
*/
unsigned long num_children;
/* Count of VMAs whose ->anon_vma pointer points to this object. */
unsigned long num_active_vmas;
struct anon_vma *parent; /* Parent of this anon_vma */ struct anon_vma *parent; /* Parent of this anon_vma */
...@@ -62,6 +58,18 @@ struct anon_vma { ...@@ -62,6 +58,18 @@ struct anon_vma {
/* Interval tree of private "related" vmas */ /* Interval tree of private "related" vmas */
struct rb_root_cached rb_root; struct rb_root_cached rb_root;
#ifndef __GENKSYMS__
/*
* Count of child anon_vmas. Equals to the count of all anon_vmas that
* have ->parent pointing to this one, including itself.
*
* This counter is used for making decision about reusing anon_vma
* instead of forking new one. See comments in function anon_vma_clone.
*/
unsigned long num_children;
/* Count of VMAs whose ->anon_vma pointer points to this object. */
unsigned long num_active_vmas;
#endif
}; };
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册