mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-30 10:49:28 +00:00
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>
This commit is contained in:
parent
d2b8178ca7
commit
65c225d328
2 changed files with 13 additions and 8 deletions
|
@ -99,14 +99,19 @@ struct compat_kexec_segment {
|
|||
|
||||
#ifdef CONFIG_KEXEC_FILE
|
||||
struct purgatory_info {
|
||||
/* Pointer to elf header of read only purgatory */
|
||||
Elf_Ehdr *ehdr;
|
||||
|
||||
/* Pointer to purgatory sechdrs which are modifiable */
|
||||
/*
|
||||
* Pointer to elf header at the beginning of kexec_purgatory.
|
||||
* Note: kexec_purgatory is read only
|
||||
*/
|
||||
const Elf_Ehdr *ehdr;
|
||||
/*
|
||||
* Temporary, modifiable buffer for sechdrs used for relocation.
|
||||
* This memory can be freed post image load.
|
||||
*/
|
||||
Elf_Shdr *sechdrs;
|
||||
/*
|
||||
* Temporary buffer location where purgatory is loaded and relocated
|
||||
* This memory can be freed post image load
|
||||
* Temporary, modifiable buffer for stripped purgatory used for
|
||||
* relocation. This memory can be freed post image load.
|
||||
*/
|
||||
void *purgatory_buf;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue