Commit ad307c6f authored by Zheng Zengkai's avatar Zheng Zengkai Committed by Aichun Shi
Browse files

x86: Avoid kabi change caused by adding pkru element in thread_struct

category: bugfix
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I5RQLJ


CVE: NA

Intel-SIG: x86: Avoid kabi change caused by adding pkru element in thread_struct.

--------------------------------
Assuming that struct thread_struct won't be accessed directly by drivers,
Using KABI_BROKEN_INSERT macro to avoid kabi change caused by commit 9782a712
("x86/fpu: Add PKRU storage outside of task XSAVE buffer").

Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: default avatarLin Wang <lin.x.wang@intel.com>
Signed-off-by: default avatarAichun Shi <aichun.shi@intel.com>
parent c98b1305
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ struct vm86;
#include <linux/err.h>
#include <linux/irqflags.h>
#include <linux/mem_encrypt.h>
#include <linux/kabi.h>

/*
 * We handle most unaligned accesses in hardware.  On the other hand
@@ -550,6 +551,7 @@ struct thread_struct {
	unsigned int		iopl_warn:1;
	unsigned int		sig_on_uaccess_err:1;

#ifdef CONFIG_X86_64
	/*
	 * Protection Keys Register for Userspace.  Loaded immediately on
	 * context switch. Store it in thread_struct to avoid a lookup in
@@ -557,7 +559,8 @@ struct thread_struct {
	 * task is scheduled out. For 'current' the authoritative source of
	 * PKRU is the hardware itself.
	 */
	u32                     pkru;
	KABI_BROKEN_INSERT(u32 pkru)
#endif

	/* Floating point and extended processor state */
	struct fpu		fpu;