Re: [PATCH 1/3] x86/umip: Check that the instruction opcode is at least two bytes

From: Borislav Petkov

Date: Sat Sep 20 2025 - 06:07:27 EST


On Fri, Sep 19, 2025 at 02:24:58PM -0700, Sean Christopherson wrote:
> The "weirdness" I am referring to is purely speculative; what I was trying to say
> is that I deliberate went with a "bad" check on nbytes, i.e. it really should be
> "insn->opcode.nbytes == 2". But I didn't want to risk breaking some bizarre
> userspace that happened to be relying on a quirk of the kernel's decoder (I
> haven't dug into the decoder, so I genuinely have/had no idea what all could
> happen).

Yeah, after yesterday, my todo list has one more item - to dig into the
decoder and see what's going on there.

For example, in this particular case, the decoder should report an error when
it cannot decode the insn instead of emulating a totally different insn...

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette