efi_selftest: do not write to linker generated array
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 19 Oct 2018 05:51:26 +0000 (07:51 +0200)
committerAlexander Graf <agraf@suse.de>
Sun, 2 Dec 2018 20:59:37 +0000 (21:59 +0100)
commit4c174394caa814a185121e7b06a41dc4be5c774a
tree462434baa564d79739f93451ec7afe017ab280a0
parent81ea00838c682da06637bcf208549095181df337
efi_selftest: do not write to linker generated array

Linker generated arrays may be stored in code sections of memory that are
not writable. So let's allocate setup_ok as an array at runtime.

This avoids an illegal memory access observed in the sandbox.

Reported-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
include/efi_selftest.h
lib/efi_selftest/efi_selftest.c