diff options
| author | Alexander Potapenko <glider@google.com> | 2024-04-30 15:05:03 +0200 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2024-04-30 13:24:04 +0000 |
| commit | a9099be4f9494bbd31b891863568f661ddd9c509 (patch) | |
| tree | baf3ef2a202ef92c4f6076b994c906e8c6efca67 /executor/executor_linux.h | |
| parent | 528d487f9857a005ddf12721ab7a2b1c8d22b515 (diff) | |
pkg/ifuzz: fix instruction decoding on x86
Decode() was only checking full opcode byte(s), whereas certain
instructions are encoded in a way that some bits of the opcode are
stored in the ModR/M byte.
In particular, e.g. there is a variation of MUL encoded as:
F7 /4
(which means the opcode byte is F7, and MODRM.reg is 4), and a variation
of TEST encoded as:
F7 /0
(opcode byte is also F7, and MODRM.reg is 0), which were previously
indistinguishable (the decoder would incorrectly treat the MUL instruction
as a TEST instruction if there were at least four extra bytes following it).
Make sure to calculate and check the MODRM.reg value if insn.Reg is set to a
non-negative value.
Diffstat (limited to 'executor/executor_linux.h')
0 files changed, 0 insertions, 0 deletions
