Ard Biesheuvel | 6b995f5 | 2021-10-01 20:06:35 +0000 | [diff] [blame] | 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 | |
| 18 | #include <linux/linkage.h> |
| 19 | #include <asm/assembler.h> |
| 20 | |
| 21 | .section ".init.rodata", "a" |
| 22 | |
| 23 | .align 2 |
| 24 | .globl fips140_rela_text |
| 25 | fips140_rela_text: |
| 26 | .weak __sec_rela_text |
| 27 | .long __sec_rela_text - . |
| 28 | .long 0 |
| 29 | |
| 30 | .globl fips140_rela_rodata |
| 31 | fips140_rela_rodata: |
| 32 | .weak __sec_rela_rodata |
| 33 | .long __sec_rela_rodata - . |
| 34 | .long 0 |