Defining kexec_purgatory as a zero-length char array upsets compile time size checking. Since this is built on a per-arch basis, define it as an unsized char array (like is done for other similar things, e.g. linker sections). This silences the warning generated by the future CONFIG_FORTIFY_SOURCE, which did not like the memcmp() of a "0 byte" array. This drops the __weak and uses an extern instead, since both users define kexec_purgatory. Change-Id: I0bc8e57b155461d6c8c904e82eff6554f07f290b Link: http://lkml.kernel.org/r/1497903987-21002-4-git-send-email-keescook@chromium.org Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Daniel Micay <danielmicay@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: e2ae8ab4b571e2e4094a28acb60649bc2732c67f Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
46 lines
1.3 KiB
C
46 lines
1.3 KiB
C
#ifndef LINUX_KEXEC_INTERNAL_H
|
|
#define LINUX_KEXEC_INTERNAL_H
|
|
|
|
#include <linux/kexec.h>
|
|
|
|
struct kimage *do_kimage_alloc_init(void);
|
|
int sanity_check_segment_list(struct kimage *image);
|
|
void kimage_free_page_list(struct list_head *list);
|
|
void kimage_free(struct kimage *image);
|
|
int kimage_load_segment(struct kimage *image, struct kexec_segment *segment);
|
|
void kimage_terminate(struct kimage *image);
|
|
int kimage_is_destination_range(struct kimage *image,
|
|
unsigned long start, unsigned long end);
|
|
|
|
extern struct mutex kexec_mutex;
|
|
|
|
#ifdef CONFIG_KEXEC_FILE
|
|
struct kexec_sha_region {
|
|
unsigned long start;
|
|
unsigned long len;
|
|
};
|
|
|
|
/*
|
|
* Keeps track of buffer parameters as provided by caller for requesting
|
|
* memory placement of buffer.
|
|
*/
|
|
struct kexec_buf {
|
|
struct kimage *image;
|
|
char *buffer;
|
|
unsigned long bufsz;
|
|
unsigned long mem;
|
|
unsigned long memsz;
|
|
unsigned long buf_align;
|
|
unsigned long buf_min;
|
|
unsigned long buf_max;
|
|
bool top_down; /* allocate from top of memory hole */
|
|
};
|
|
|
|
void kimage_file_post_load_cleanup(struct kimage *image);
|
|
extern char kexec_purgatory[];
|
|
extern size_t kexec_purgatory_size;
|
|
#else /* CONFIG_KEXEC_FILE */
|
|
static inline void kimage_file_post_load_cleanup(struct kimage *image) { }
|
|
#endif /* CONFIG_KEXEC_FILE */
|
|
#endif /* LINUX_KEXEC_INTERNAL_H */
|