arm64 fixes for 5.2
- Fix module allocation when running with KASLR enabled - Fix broken build due to bug in LLVM linker (ld.lld) -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEPxTL6PPUbjXGY88ct6xw3ITBYzQFAl0Z9bIACgkQt6xw3ITB YzS70gf/Trw6+Yy1dHSyz5f2W9OtedFFv+rEGcvUkF6kYFffw7taNj30K6otjkK7 CYPp9kWYpFhGgE7VwAfQ9NGyAwZ62IvGhQDYdAG72Y39zX7yQ4OHWKdr8K53KYN8 CThcgXxEPoZw1pP7fwXkaBiiljW6JGF64Hv3ybA1vzGmjiv6wdjO3pQlbXkJu4kk xlsLSLOZUDawcRuVNGWwPiToxopVTcAJ3lapYBVmO2dSO00QYv1jvJgV0tK6n68q ZQMJbTdNHLIKMRdLcDBGQAwetWkkZ5LazwuiaHQcSQcRgp7IkKrIvEz8vzkdAvcR jniDc7bbKYlvlJdiquIOH2l1ElEQyQ== =Pp2j -----END PGP SIGNATURE----- Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "Fix a build failure with the LLVM linker and a module allocation failure when KASLR is active: - Fix module allocation when running with KASLR enabled - Fix broken build due to bug in LLVM linker (ld.lld)" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64/efi: Mark __efistub_stext_offset as an absolute symbol explicitly arm64: kaslr: keep modules inside module region when KASAN is enabled
This commit is contained in:
Коммит
4b1fe9b58e
|
@ -67,7 +67,11 @@
|
||||||
|
|
||||||
#ifdef CONFIG_EFI
|
#ifdef CONFIG_EFI
|
||||||
|
|
||||||
__efistub_stext_offset = stext - _text;
|
/*
|
||||||
|
* Use ABSOLUTE() to avoid ld.lld treating this as a relative symbol:
|
||||||
|
* https://github.com/ClangBuiltLinux/linux/issues/561
|
||||||
|
*/
|
||||||
|
__efistub_stext_offset = ABSOLUTE(stext - _text);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The EFI stub has its own symbol namespace prefixed by __efistub_, to
|
* The EFI stub has its own symbol namespace prefixed by __efistub_, to
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
void *module_alloc(unsigned long size)
|
void *module_alloc(unsigned long size)
|
||||||
{
|
{
|
||||||
|
u64 module_alloc_end = module_alloc_base + MODULES_VSIZE;
|
||||||
gfp_t gfp_mask = GFP_KERNEL;
|
gfp_t gfp_mask = GFP_KERNEL;
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
|
@ -28,9 +29,12 @@ void *module_alloc(unsigned long size)
|
||||||
if (IS_ENABLED(CONFIG_ARM64_MODULE_PLTS))
|
if (IS_ENABLED(CONFIG_ARM64_MODULE_PLTS))
|
||||||
gfp_mask |= __GFP_NOWARN;
|
gfp_mask |= __GFP_NOWARN;
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_KASAN))
|
||||||
|
/* don't exceed the static module region - see below */
|
||||||
|
module_alloc_end = MODULES_END;
|
||||||
|
|
||||||
p = __vmalloc_node_range(size, MODULE_ALIGN, module_alloc_base,
|
p = __vmalloc_node_range(size, MODULE_ALIGN, module_alloc_base,
|
||||||
module_alloc_base + MODULES_VSIZE,
|
module_alloc_end, gfp_mask, PAGE_KERNEL_EXEC, 0,
|
||||||
gfp_mask, PAGE_KERNEL_EXEC, 0,
|
|
||||||
NUMA_NO_NODE, __builtin_return_address(0));
|
NUMA_NO_NODE, __builtin_return_address(0));
|
||||||
|
|
||||||
if (!p && IS_ENABLED(CONFIG_ARM64_MODULE_PLTS) &&
|
if (!p && IS_ENABLED(CONFIG_ARM64_MODULE_PLTS) &&
|
||||||
|
|
Загрузка…
Ссылка в новой задаче