summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/x86/entry_from_vm86.c
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2015-09-05 02:00:43 +0200
committerIngo Molnar <mingo@kernel.org>2015-09-05 09:01:16 +0200
commit76fc5e7b2355af167dea1a32e93c57fc37900a5b (patch)
tree0db0ca6a7f1a689a7efdcf1539bacf330cc1715c /tools/testing/selftests/x86/entry_from_vm86.c
parentMerge branch 'linus' into x86/urgent, to be able to merge a dependent fix (diff)
downloadlinux-76fc5e7b2355af167dea1a32e93c57fc37900a5b.tar.xz
linux-76fc5e7b2355af167dea1a32e93c57fc37900a5b.zip
x86/vm86: Block non-root vm86(old) if mmap_min_addr != 0
vm86 exposes an interesting attack surface against the entry code. Since vm86 is mostly useless anyway if mmap_min_addr != 0, just turn it off in that case. There are some reports that vbetool can work despite setting mmap_min_addr to zero. This shouldn't break that use case, as CAP_SYS_RAWIO already overrides mmap_min_addr. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Andy Lutomirski <luto@kernel.org> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Austin S Hemmelgarn <ahferroin7@gmail.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Josh Boyer <jwboyer@fedoraproject.org> Cc: Kees Cook <keescook@chromium.org> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stas Sergeev <stsp@list.ru> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/testing/selftests/x86/entry_from_vm86.c')
-rw-r--r--tools/testing/selftests/x86/entry_from_vm86.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/x86/entry_from_vm86.c b/tools/testing/selftests/x86/entry_from_vm86.c
index 9a43a59a9bb4..421c607a8856 100644
--- a/tools/testing/selftests/x86/entry_from_vm86.c
+++ b/tools/testing/selftests/x86/entry_from_vm86.c
@@ -116,8 +116,9 @@ static bool do_test(struct vm86plus_struct *v86, unsigned long eip,
v86->regs.eip = eip;
ret = vm86(VM86_ENTER, v86);
- if (ret == -1 && errno == ENOSYS) {
- printf("[SKIP]\tvm86 not supported\n");
+ if (ret == -1 && (errno == ENOSYS || errno == EPERM)) {
+ printf("[SKIP]\tvm86 %s\n",
+ errno == ENOSYS ? "not supported" : "not allowed");
return false;
}