diff options
author | 2025-04-28 10:48:20 +0900 | |
---|---|---|
committer | 2025-05-06 12:03:16 +0200 | |
commit | 4b626015e1bf119cd31d7e62f9bd9eb1412fce7b (patch) | |
tree | f1d3986efb8aab54a688d816f6cac1c0e15fc3b9 /scripts/gdb/linux/utils.py | |
parent | x86/insn: Fix opcode map (!REX2) superscript tags (diff) | |
download | linux-rng-4b626015e1bf119cd31d7e62f9bd9eb1412fce7b.tar.xz linux-rng-4b626015e1bf119cd31d7e62f9bd9eb1412fce7b.zip |
x86/insn: Stop decoding i64 instructions in x86-64 mode at opcode
In commit 2e044911be75 ("x86/traps: Decode 0xEA instructions as #UD")
FineIBT starts using 0xEA as an invalid instruction like UD2. But
insn decoder always returns the length of "0xea" instruction as 7
because it does not check the (i64) superscript.
The x86 instruction decoder should also decode 0xEA on x86-64 as
a one-byte invalid instruction by decoding the "(i64)" superscript tag.
This stops decoding instruction which has (i64) but does not have (o64)
superscript in 64-bit mode at opcode and skips other fields.
With this change, insn_decoder_test says 0xea is 1 byte length if
x86-64 (-y option means 64-bit):
$ printf "0:\tea\t\n" | insn_decoder_test -y -v
insn_decoder_test: success: Decoded and checked 1 instructions
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/174580490000.388420.5225447607417115496.stgit@devnote2
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions