On Mon, Nov 09, 2026 at 08:49:06PM +0100, Jiri Olsa wrote:
quoted hunk ↗ jump to hunk
int arch_jump_entry_size(struct jump_entry *entry)
{
+ const u8 *code = (void *)jump_entry_code(entry);
+ if (code[0] == JMP8_INSN_OPCODE ||
+ !memcmp(code, x86_nops[JMP8_INSN_SIZE], JMP8_INSN_SIZE))
+ return JMP8_INSN_SIZE;
+ if (code[0] == JMP32_INSN_OPCODE ||
+ !memcmp(code, x86_nops[JMP32_INSN_SIZE], JMP32_INSN_SIZE))
+ return JMP32_INSN_SIZE;
+
+ BUG();
}
Does this actually generate sane code and checks code[0] first for both
values before it goes and does memcmp() ? The naive translation would
suggest it does not.