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