Skip to content

Commit

Permalink
selftests/x86: Add a fork() to entry_from_vm86 to catch fork bugs
Browse files Browse the repository at this point in the history
Mere possession of vm86 state is strange.  Make sure that nothing
gets corrupted if we fork after calling vm86().

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Stas Sergeev <stsp@list.ru>
Link: http://lkml.kernel.org/r/08f83295460a80e41dc5e3e81ec40d6844d316f5.1446270067.git.luto@kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Andy Lutomirski authored and Thomas Gleixner committed Oct 31, 2015
1 parent ababae4 commit 226f1f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/testing/selftests/x86/entry_from_vm86.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,5 +230,9 @@ int main(void)
}
clearhandler(SIGSEGV);

/* Make sure nothing explodes if we fork. */
if (fork() > 0)
return 0;

return (nerrs == 0 ? 0 : 1);
}

0 comments on commit 226f1f7

Please sign in to comment.