diff options
author | Philipp Rudo <prudo@linux.vnet.ibm.com> | 2018-04-13 18:36:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-13 20:10:28 -0400 |
commit | 65c225d3280542f3ea145e052215ce0538f6bb69 (patch) | |
tree | 7d8d0f4239303c4182cf79c35ed2012aca64832c /kernel/kexec_file.c | |
parent | d2b8178ca7324a21495cb71049b4e4a041ab5942 (diff) |
kernel/kexec_file.c: make purgatory_info->ehdr const
The kexec_purgatory buffer is read-only. Thus all pointers into
kexec_purgatory are read-only, too. Point this out by explicitly
marking purgatory_info->ehdr as 'const' and update the comments in
purgatory_info.
Link: http://lkml.kernel.org/r/20180321112751.22196-4-prudo@linux.vnet.ibm.com
Signed-off-by: Philipp Rudo <prudo@linux.vnet.ibm.com>
Acked-by: Dave Young <dyoung@redhat.com>
Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/kexec_file.c')
-rw-r--r-- | kernel/kexec_file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 81ba4f782486..12cf9c9ff0bc 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c | |||
@@ -941,7 +941,7 @@ int kexec_load_purgatory(struct kimage *image, unsigned long min, | |||
941 | if (kexec_purgatory_size <= 0) | 941 | if (kexec_purgatory_size <= 0) |
942 | return -EINVAL; | 942 | return -EINVAL; |
943 | 943 | ||
944 | pi->ehdr = (Elf_Ehdr *)kexec_purgatory; | 944 | pi->ehdr = (const Elf_Ehdr *)kexec_purgatory; |
945 | 945 | ||
946 | ret = __kexec_load_purgatory(image, min, max, top_down); | 946 | ret = __kexec_load_purgatory(image, min, max, top_down); |
947 | if (ret) | 947 | if (ret) |
@@ -965,9 +965,9 @@ out: | |||
965 | static Elf_Sym *kexec_purgatory_find_symbol(struct purgatory_info *pi, | 965 | static Elf_Sym *kexec_purgatory_find_symbol(struct purgatory_info *pi, |
966 | const char *name) | 966 | const char *name) |
967 | { | 967 | { |
968 | const Elf_Ehdr *ehdr; | ||
968 | Elf_Sym *syms; | 969 | Elf_Sym *syms; |
969 | Elf_Shdr *sechdrs; | 970 | Elf_Shdr *sechdrs; |
970 | Elf_Ehdr *ehdr; | ||
971 | int i, k; | 971 | int i, k; |
972 | const char *strtab; | 972 | const char *strtab; |
973 | 973 | ||