diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2021-10-20 19:43:55 +0200 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2021-10-25 22:56:29 +0200 |
commit | 1a4d21a23c4ca7467726be7db9ae8077a62b2c62 (patch) | |
tree | 4ef9aa31d332a963ae21cb767429a429241bccef /arch/x86 | |
parent | signal/sparc: In setup_tsb_params convert open coded BUG into BUG (diff) | |
download | linux-1a4d21a23c4ca7467726be7db9ae8077a62b2c62.tar.xz linux-1a4d21a23c4ca7467726be7db9ae8077a62b2c62.zip |
signal/vm86_32: Replace open coded BUG_ON with an actual BUG_ON
The function save_v86_state is only called when userspace was
operating in vm86 mode before entering the kernel. Not having vm86
state in the task_struct should never happen. So transform the hand
rolled BUG_ON into an actual BUG_ON to make it clear what is
happening.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org
Cc: H Peter Anvin <hpa@zytor.com>
Link: https://lkml.kernel.org/r/20211020174406.17889-9-ebiederm@xmission.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/vm86_32.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c index e5a7a10a0164..63486da77272 100644 --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c @@ -106,10 +106,8 @@ void save_v86_state(struct kernel_vm86_regs *regs, int retval) */ local_irq_enable(); - if (!vm86 || !vm86->user_vm86) { - pr_alert("no user_vm86: BAD\n"); - do_exit(SIGSEGV); - } + BUG_ON(!vm86 || !vm86->user_vm86); + set_flags(regs->pt.flags, VEFLAGS, X86_EFLAGS_VIF | vm86->veflags_mask); user = vm86->user_vm86; |