Re: [patch v2 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect
From: Peter Zijlstra
Date: Fri Apr 03 2020 - 10:33:59 EST
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.