2019-08-14 07:04:50 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
|
|
|
* Linker script variables to be set after section resolution, as
|
|
|
|
* ld.lld does not like variables assigned before SECTIONS is processed.
|
|
|
|
*/
|
|
|
|
#ifndef __ARM64_KERNEL_IMAGE_VARS_H
|
|
|
|
#define __ARM64_KERNEL_IMAGE_VARS_H
|
|
|
|
|
|
|
|
#ifndef LINKER_SCRIPT
|
|
|
|
#error This file should only be included in vmlinux.lds.S
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_EFI
|
|
|
|
|
2020-02-17 19:44:37 +08:00
|
|
|
__efistub_kernel_size = _edata - _text;
|
|
|
|
|
2019-08-14 07:04:50 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The EFI stub has its own symbol namespace prefixed by __efistub_, to
|
|
|
|
* isolate it from the kernel proper. The following symbols are legally
|
|
|
|
* accessed by the stub, so provide some aliases to make them accessible.
|
|
|
|
* Only include data symbols here, or text symbols of functions that are
|
|
|
|
* guaranteed to be safe when executed at another offset than they were
|
|
|
|
* linked at. The routines below are all implemented in assembler in a
|
|
|
|
* position independent manner
|
|
|
|
*/
|
|
|
|
__efistub_memcmp = __pi_memcmp;
|
|
|
|
__efistub_memchr = __pi_memchr;
|
|
|
|
__efistub_memcpy = __pi_memcpy;
|
|
|
|
__efistub_memmove = __pi_memmove;
|
|
|
|
__efistub_memset = __pi_memset;
|
|
|
|
__efistub_strlen = __pi_strlen;
|
|
|
|
__efistub_strnlen = __pi_strnlen;
|
|
|
|
__efistub_strcmp = __pi_strcmp;
|
|
|
|
__efistub_strncmp = __pi_strncmp;
|
|
|
|
__efistub_strrchr = __pi_strrchr;
|
|
|
|
__efistub___flush_dcache_area = __pi___flush_dcache_area;
|
|
|
|
|
|
|
|
#ifdef CONFIG_KASAN
|
|
|
|
__efistub___memcpy = __pi_memcpy;
|
|
|
|
__efistub___memmove = __pi_memmove;
|
|
|
|
__efistub___memset = __pi_memset;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
__efistub__text = _text;
|
2020-02-17 19:44:37 +08:00
|
|
|
__efistub_stext = stext;
|
2019-08-14 07:04:50 +08:00
|
|
|
__efistub__end = _end;
|
|
|
|
__efistub__edata = _edata;
|
|
|
|
__efistub_screen_info = screen_info;
|
efi/libstub: Clean up command line parsing routine
We currently parse the command non-destructively, to avoid having to
allocate memory for a copy before passing it to the standard parsing
routines that are used by the core kernel, and which modify the input
to delineate the parsed tokens with NUL characters.
Instead, we call strstr() and strncmp() to go over the input multiple
times, and match prefixes rather than tokens, which implies that we
would match, e.g., 'nokaslrfoo' in the stub and disable KASLR, while
the kernel would disregard the option and run with KASLR enabled.
In order to avoid having to reason about whether and how this behavior
may be abused, let's clean up the parsing routines, and rebuild them
on top of the existing helpers.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2020-02-11 00:02:46 +08:00
|
|
|
__efistub__ctype = _ctype;
|
2019-08-14 07:04:50 +08:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __ARM64_KERNEL_IMAGE_VARS_H */
|