]> git.baikalelectronics.ru Git - kernel.git/commit
x86/fault: Improve kernel-executing-user-memory handling
authorAndy Lutomirski <luto@kernel.org>
Wed, 10 Feb 2021 02:33:39 +0000 (18:33 -0800)
committerBorislav Petkov <bp@suse.de>
Wed, 10 Feb 2021 13:20:54 +0000 (14:20 +0100)
commit03c81ea3331658f613bb2913d33764a4e0410cbd
tree45cb1cc0a2e2aacd630b2db3a734c97b9ec730df
parent56e62cd28aaae2fcbec8af67b05843c47c6da170
x86/fault: Improve kernel-executing-user-memory handling

Right now, the case of the kernel trying to execute from user memory
is treated more or less just like the kernel getting a page fault on a
user access. In the failure path, it checks for erratum #93, tries to
otherwise fix up the error, and then oopses.

If it manages to jump to the user address space, with or without SMEP,
it should not try to resolve the page fault. This is an error, pure and
simple. Rearrange the code so that this case is caught early, check for
erratum #93, and bail out.

 [ bp: Massage commit message. ]

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/ab8719c7afb8bd501c4eee0e36493150fbbe5f6a.1612924255.git.luto@kernel.org
arch/x86/mm/fault.c