Messages in this thread | | | Date | Fri, 12 Sep 2014 19:48:27 +0200 (CEST) | From | Thomas Gleixner <> | Subject | Re: [PATCH v8 07/10] x86, mpx: decode MPX instruction to get bound violation information |
| |
On Fri, 12 Sep 2014, H. Peter Anvin wrote: > The correct limit is 15 bytes, not anything else, so this is a bug in > the existing decoder. A sequence of bytes longer than 15 bytes will
Fine. Lets fix it there.
> #UD, regardless of being "otherwise valid".
> Keep in mind the instruction may not be aligned, and you could fit an > instruction plus a jump and still overrun a page in 15 bytes.
Fair enough. OTOH, I doubt that a text mapping will end exactly at that jump after the MPX instruction.
So that's simple to fix.
Kill the hardcoded limit in lib/insn.c and let the callsites hand in a lenght argument. So you can still use it for MPX and avoid 200 lines of blindly copied and slightly different decoder code.
Thanks,
tglx
| |