+ arm64-move-jump_label_init-before-parse_early_param.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: arm64: move jump_label_init() before parse_early_param()
has been added to the -mm tree.  Its filename is
     arm64-move-jump_label_init-before-parse_early_param.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/arm64-move-jump_label_init-before-parse_early_param.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/arm64-move-jump_label_init-before-parse_early_param.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Kees Cook <keescook@xxxxxxxxxxxx>
Subject: arm64: move jump_label_init() before parse_early_param()

While jump_label_init() was moved earlier in the boot process in
efd9e03facd0 ("arm64: Use static keys for CPU features"), it wasn't early
enough for early params to use it.  The old state of things was as
described here...

init/main.c calls out to arch-specific things before general jump label
and early param handling:

asmlinkage __visible void __init start_kernel(void)
{
        ...
        setup_arch(&command_line);
        ...
        smp_prepare_boot_cpu();
        ...
        /* parameters may set static keys */
        jump_label_init();
        parse_early_param();
        ...
}

x86 setup_arch() wants those earlier, so it handles jump label and
early param:

void __init setup_arch(char **cmdline_p)
{
        ...
        jump_label_init();
        ...
        parse_early_param();
        ...
}

arm64 setup_arch() only had early param:

void __init setup_arch(char **cmdline_p)
{
        ...
        parse_early_param();
        ...
}

with jump label later in smp_prepare_boot_cpu():

void __init smp_prepare_boot_cpu(void)
{
        ...
        jump_label_init();
        ...
}

This moves arm64 jump_label_init() from smp_prepare_boot_cpu() to
setup_arch(), as done already on x86, in preparation from early param
usage in the init_on_alloc/free() series:
https://lkml.kernel.org/r/1561572949.5154.81.camel@xxxxxx

Link: http://lkml.kernel.org/r/201906271003.005303B52@keescook
Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
Acked-by: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>
Acked-by: Catalin Marinas <catalin.marinas@xxxxxxx>
Cc: Alexander Potapenko <glider@xxxxxxxxxx>
Cc: Qian Cai <cai@xxxxxx>
Cc: Will Deacon <will@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 arch/arm64/kernel/setup.c |    5 +++++
 arch/arm64/kernel/smp.c   |    5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

--- a/arch/arm64/kernel/setup.c~arm64-move-jump_label_init-before-parse_early_param
+++ a/arch/arm64/kernel/setup.c
@@ -283,6 +283,11 @@ void __init setup_arch(char **cmdline_p)
 
 	setup_machine_fdt(__fdt_pointer);
 
+	/*
+	 * Initialise the static keys early as they may be enabled by the
+	 * cpufeature code and early parameters.
+	 */
+	jump_label_init();
 	parse_early_param();
 
 	/*
--- a/arch/arm64/kernel/smp.c~arm64-move-jump_label_init-before-parse_early_param
+++ a/arch/arm64/kernel/smp.c
@@ -424,11 +424,6 @@ void __init smp_cpus_done(unsigned int m
 void __init smp_prepare_boot_cpu(void)
 {
 	set_my_cpu_offset(per_cpu_offset(smp_processor_id()));
-	/*
-	 * Initialise the static keys early as they may be enabled by the
-	 * cpufeature code.
-	 */
-	jump_label_init();
 	cpuinfo_store_boot_cpu();
 
 	/*
_

Patches currently in -mm which might be from keescook@xxxxxxxxxxxx are

mm-slab-validate-cache-membership-under-freelist-hardening.patch
mm-slab-sanity-check-page-type-when-looking-up-cache.patch
lkdtm-heap-add-tests-for-freelist-hardening.patch
arm64-move-jump_label_init-before-parse_early_param.patch
lib-test_overflow-avoid-tainting-the-kernel-and-fix-wrap-size.patch
mm-kconfig-fix-neighboring-typos.patch
ipc-mqueue-only-perform-resource-calculation-if-user-valid.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux