Commit 92ce2bd4 authored by Sean Christopherson's avatar Sean Christopherson Committed by Zheng Zengkai
Browse files

x86/fault: Add a helper function to sanitize error code

mainline inclusion
from mainline-v5.11-rc1
commit cd072dab
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4SIGI


CVE: NA

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

vDSO exception fixup is a replacement for signals in limited situations.
Signals and vDSO exception fixup need to provide similar information to
userspace, including the hardware error code.

That hardware error code needs to be sanitized.  For instance, if userspace
accesses a kernel address, the error code could indicate to userspace
whether the address had a Present=1 PTE.  That can leak information about
the kernel layout to userspace, which is bad.

The existing signal code does this sanitization, but fairly late in the
signal process.  The vDSO exception code runs before the sanitization
happens.

Move error code sanitization out of the signal code and into a helper.
Call the helper in the signal code.

Intel-SIG: commit cd072dab x86/fault: Add a helper function to
sanitize error code.
Backport summary: This is a dependency patch for CET preparation patch

Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Acked-by: default avatarJethro Beekman <jethro@fortanix.com>
Link: https://lkml.kernel.org/r/20201112220135.165028-18-jarkko@kernel.org


Signed-off-by: Fan Du <fan.du@intel.com> #openEuler_contributor
Signed-off-by: default avatarLaibin Qiu <qiulaibin@huawei.com>
Reviewed-by: default avatarBamvor Zhang <bamvor.zhang@suse.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 4f6a4993
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment