Commit 4b1fe9b5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 6fbc7275 aa69fb62
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -67,7 +67,11 @@

#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
+6 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@

void *module_alloc(unsigned long size)
{
	u64 module_alloc_end = module_alloc_base + MODULES_VSIZE;
	gfp_t gfp_mask = GFP_KERNEL;
	void *p;

@@ -28,9 +29,12 @@ void *module_alloc(unsigned long size)
	if (IS_ENABLED(CONFIG_ARM64_MODULE_PLTS))
		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,
				module_alloc_base + MODULES_VSIZE,
				gfp_mask, PAGE_KERNEL_EXEC, 0,
				module_alloc_end, gfp_mask, PAGE_KERNEL_EXEC, 0,
				NUMA_NO_NODE, __builtin_return_address(0));

	if (!p && IS_ENABLED(CONFIG_ARM64_MODULE_PLTS) &&