Re: [RESEND PATCH v2 0/2] *** Fix reformat_objdump.awk ***

From: Kees Cook
Date: Fri Oct 13 2023 - 13:17:46 EST


*thread necromancy*

These patches still apply and are still needed to correctly process
objdump output. It accidentally doesn't produce any errors currently,
but manual inspection shows mangled results.

Can an x86 maintainer take these two patches please? I can carry them if
that's preferred?

Note that there is an older Ack from Masami:

https://lore.kernel.org/all/20220107205259.e66ff1bd90ac218611bf1178@xxxxxxxxxx/

Acked-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>

And I've now reviewed and tested this too:

Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>
Tested-by: Kees Cook <keescook@xxxxxxxxxxxx>

Thanks!

-Kees

On Sat, Nov 12, 2022 at 07:04:15PM +1000, Samuel Zeter wrote:
> These are two small patches which originally dealt with
> the problem found at:
>
> https://github.com/ClangBuiltLinux/linux/issues/1364
>
> The original steps to reproduce were:
> $ make -skj"$(nproc)" LLVM=1 LLVM_IAS=1 defconfig
> $ scripts/config -e X86_DECODER_SELFTEST
> $ make -skj"$(nproc)" LLVM=1 LLVM_IAS=1 olddefconfig bzImage
>
> Which resulted in the error:
> arch/x86/tools/insn_decoder_test: warning: objdump says 0 bytes, but
> insn_get_length() says 2
>
> Upon inspection it turned out llvm-objdump was formatting its
> output differently, which caused objdump_reformat.awk to incorrectly
> output its values.
>
> After fixing that bug, a second one was seen where the instruction
> "wait" was incorrectly matched with "fwait", which again caused
> insn_decoder_test to fail.
>
> Samuel Zeter (2):
> arch/x86/tools/objdump_reformat.awk: Ensure regex matches fwait
> arch/x86/tools/objdump_reformat.awk: Allow for spaces
>
> arch/x86/tools/objdump_reformat.awk | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>
> base-commit: 151297128990b4b44be8d70b983053831fa857f6
> --
> 2.38.1
>

--
Kees Cook