#1049460 Undefined Opcode exception at EFI Shell after launching KeyTool.efi (armhf) binary

Package:
efitools
Source:
efitools
Description:
Tools to manipulate EFI secure boot keys and signatures
Submitter:
Date:
2023-08-22 05:15:03 UTC
Severity:
normal
#1049460#5
Date:
2023-08-16 05:49:16 UTC
From:
To:
Dear Maintainer,

This experiment was done in the debian bookworm docker image. I have used QEMU virtual machine to verity secureboot.
efitools:armhf version is 1.9.2-3.

I tried to launch KeyTool.efi (armhf) in the EFI shell to store the keys for secureboot but encountered a below error.

FS1:\> KeyTool.efi
Undefined OpCode Exception PC at 0x7C747B88  CPSR 0x600F0133
Undefined OpCode Exception PC at 0x7C747B88  CPSR 0x600F0133

Binary path: /usr/lib/efitools/arm-linux-gnueabihf/KeyTool.efi

QEMU options:
------------------------------------------------------------------------------------------
ovmf_code=$(ls ./secureboot-keys/armhf/AAVMF32_CODE.fd)
ovmf_vars=$(ls ./secureboot-keys/armhf/AAVMF32_VARS.fd)
qemu-system-arm \
        -m $MEMORY_SIZE \
        -cpu cortex-a15 \
        -machine virt \
        -device virtio-scsi-pci \
        -device scsi-hd,drive=hd0 \
        -blockdev driver=file,node-name=hd0,filename=test.img \
        -device e1000,netdev=net0 \
        -netdev user,hostfwd=tcp:127.0.0.1:5555-:22,id=net0,hostfwd=tcp:127.0.0.1:2159-:2159 \
        -nographic -serial mon:stdio \
        -drive if=pflash,format=raw,unit=0,readonly=on,file=${ovmf_code} \
        -drive if=pflash,format=raw,file=${ovmf_vars} \
        -drive file=fat:rw:./secureboot-keys

Note:

  *   “secureboot-keys” is a folder where all secureboot keys are present.
  *   AAMVF CODE and VARS are installed from package https://packages.debian.org/bookworm/qemu-efi-arm

#1049460#10
Date:
2023-08-22 04:27:39 UTC
From:
To:
Dear Maintainer,

Kindly check the additional information regarding this issue which might be helpful for analysis.

I’ve checked below binaries from the efitools:armhf package,

  *   Binaries can run without the exception (not fully tested, just ran the binary to check the errors)
     *   HelloWorld.efi
     *   Loader.efi
     *   LockDown.efi
     *   ShimReplace.efi
  *   Binaries fails with the same exception
     *   KeyTool.efi
     *   HashTool.efi
     *   ReadVars.efi
     *   SetNull.efi
     *   UpdateVars.efi

Note: The Undefined OpCode exception never happens with arm64 binaries, so it's armhf specific problem
Thanks & Regards
Shivanand K