From: Guan Jing guanjing6@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4KAP1?from=project-issue CVE: NA
-------------------------------
We reserve some fields beforehand for thread_info prone to change.
Signed-off-by: Guan Jing guanjing6@huawei.com Reviewed-by: Chen Hui judy.chenhui@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- arch/arm/include/asm/thread_info.h | 3 +++ arch/arm64/include/asm/thread_info.h | 4 ++++ arch/x86/include/asm/thread_info.h | 3 +++ 3 files changed, 10 insertions(+)
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h index 2e4733a2e737..9f7ca79cc76a 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h @@ -12,6 +12,7 @@ #include <linux/compiler.h> #include <asm/fpstate.h> #include <asm/page.h> +#include <linux/kabi.h>
#ifdef CONFIG_KASAN /* @@ -73,6 +74,8 @@ struct thread_info { #ifdef CONFIG_ARM_THUMBEE unsigned long thumbee_state; /* ThumbEE Handler Base register */ #endif + KABI_RESERVE(1) + KABI_RESERVE(2) };
#define INIT_THREAD_INFO(tsk) \ diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index c826ad282dc9..6dba5059aa60 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -17,6 +17,7 @@ struct task_struct; #include <asm/memory.h> #include <asm/stack_pointer.h> #include <asm/types.h> +#include <linux/kabi.h>
typedef unsigned long mm_segment_t;
@@ -46,6 +47,9 @@ struct thread_info { void *scs_sp; #endif u32 cpu; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
#define thread_saved_pc(tsk) \ diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index 7a931f95e1ce..a225c6e2ca6d 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -12,6 +12,7 @@ #include <asm/page.h> #include <asm/percpu.h> #include <asm/types.h> +#include <linux/kabi.h>
/* * TOP_OF_KERNEL_STACK_PADDING is a number of unused bytes that we @@ -59,6 +60,8 @@ struct thread_info { #ifdef CONFIG_SMP u32 cpu; /* current CPU */ #endif + KABI_RESERVE(1) + KABI_RESERVE(2) };
#define INIT_THREAD_INFO(tsk) \