aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/entry
diff options
context:
space:
mode:
authorGravatar H. Peter Anvin (Intel) <hpa@zytor.com> 2021-05-10 11:53:13 -0700
committerGravatar Ingo Molnar <mingo@kernel.org> 2021-05-12 10:49:15 +0200
commit6de4ac1d03f75248974a398110b15af0bfe65a11 (patch)
tree1e31c0dee66b5408bbb987d6b8344f5a34a1064e /arch/x86/entry
parentx86/syscall: Unconditionally prototype {ia32,x32}_sys_call_table[] (diff)
downloadlinux-6de4ac1d03f75248974a398110b15af0bfe65a11.tar.gz
linux-6de4ac1d03f75248974a398110b15af0bfe65a11.tar.bz2
linux-6de4ac1d03f75248974a398110b15af0bfe65a11.zip
x86/syscall: Maximize MSR_SYSCALL_MASK
It is better to clear as many flags as possible when we do a system call entry, as opposed to the other way around. The fewer flags we keep, the lesser the possible interference between the kernel and user space. The flags changed are: - CF, PF, AF, ZF, SF, OF: these are arithmetic flags which affect branches, possibly speculatively. They should be cleared for the same reasons we now clear all GPRs on entry. - RF: suppresses a code breakpoint on the subsequent instruction. It is probably impossible to enter the kernel with RF set, but if it is somehow not, it would break a kernel debugger setting a breakpoint on the entry point. Either way, user space should not be able to control kernel behavior here. - ID: this flag has no direct effect (it is a scratch bit only.) However, there is no reason to retain the user space value in the kernel, and the standard should be to clear unless needed, not the other way around. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20210510185316.3307264-5-hpa@zytor.com
Diffstat (limited to 'arch/x86/entry')
0 files changed, 0 insertions, 0 deletions