Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit baedb247 authored by Kees Cook's avatar Kees Cook Committed by Olav Haugan
Browse files

kexec_file: adjust declaration of kexec_purgatory

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: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Cc: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus 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: default avatarOlav Haugan <ohaugan@codeaurora.org>
parent fe4b7990
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -25,13 +25,6 @@
#include <linux/vmalloc.h>
#include "kexec_internal.h"

/*
 * Declare these symbols weak so that if architecture provides a purgatory,
 * these will be overridden.
 */
char __weak kexec_purgatory[0];
size_t __weak kexec_purgatory_size = 0;

static int kexec_calculate_store_digests(struct kimage *image);

/* Architectures can provide this probe function */
+2 −0
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ struct kexec_buf {
};

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 */