lkml.org 
[lkml]   [2020]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch v2 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect
On Fri, Apr 03, 2020 at 08:09:03AM +0000, David Laight wrote:
> 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?

It's module load, why would you care? I suspect it's really fast, but
even if it wasn't I couldn't be arsed.

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