fips140-refs.S 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright 2021 Google LLC
  4. * Author: Ard Biesheuvel <ardb@google.com>
  5. *
  6. * This file contains the variable definitions that will be used by the FIPS140
  7. * s/w module to access the RELA sections in the ELF image. These are used to
  8. * apply the relocations applied by the module loader in reverse, so that we
  9. * can reconstruct the image that was used to derive the HMAC used by the
  10. * integrity check.
  11. *
  12. * The first .long of each entry will be populated by the module loader based
  13. * on the actual placement of the respective RELA section in memory. The second
  14. * .long carries the RELA entry count, and is populated by the host tool that
  15. * also generates the HMAC of the contents of .text and .rodata.
  16. */
  17. #include <linux/linkage.h>
  18. #include <asm/assembler.h>
  19. .section ".init.rodata", "a"
  20. .align 2
  21. .globl fips140_rela_text
  22. fips140_rela_text:
  23. .weak __sec_rela_text
  24. .long __sec_rela_text - .
  25. .long 0
  26. .globl fips140_rela_rodata
  27. fips140_rela_rodata:
  28. .weak __sec_rela_rodata
  29. .long __sec_rela_rodata - .
  30. .long 0