lkml.org 
[lkml]   [2020]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [patch v2 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect
Date
From: Peter Zijlstra
> Sent: 02 April 2020 16:24
>
> I picked VMXOFF (which also appears in vmmon.ko) instead of VMXON
> because that latter takes an argument is therefore more difficult to
> decode.
...
> + while (text < text_end) {
> + kernel_insn_init(&insn, text, text_end - text);
> + insn_get_length(&insn);
> +
> + if (WARN_ON_ONCE(!insn_complete(&insn)))
> + break;
> +
> + if (insn.length == 3 &&
> + (!memcmp(text, vmlaunch, sizeof(vmlaunch)) ||
> + !memcmp(text, vmxoff, sizeof(vmxoff))))
> + goto bad_module;
> +
> + text += insn.length;
> + }

How long is that going to take on a module with (say) 400k of text?

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2020-04-03 10:09    [W:0.736 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site