Patch "arm64: Fix KASAN random tag seed initialization" has been added to the 6.6-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    arm64: Fix KASAN random tag seed initialization

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     arm64-fix-kasan-random-tag-seed-initialization.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 204fb524b13759bb3eeabba8c80f6b018d87a3d3
Author: Samuel Holland <samuel.holland@xxxxxxxxxx>
Date:   Wed Aug 14 02:09:53 2024 -0700

    arm64: Fix KASAN random tag seed initialization
    
    [ Upstream commit f75c235565f90c4a17b125e47f1c68ef6b8c2bce ]
    
    Currently, kasan_init_sw_tags() is called before setup_per_cpu_areas(),
    so per_cpu(prng_state, cpu) accesses the same address regardless of the
    value of "cpu", and the same seed value gets copied to the percpu area
    for every CPU. Fix this by moving the call to smp_prepare_boot_cpu(),
    which is the first architecture hook after setup_per_cpu_areas().
    
    Fixes: 3c9e3aa11094 ("kasan: add tag related helper functions")
    Fixes: 3f41b6093823 ("kasan: fix random seed generation for tag-based mode")
    Signed-off-by: Samuel Holland <samuel.holland@xxxxxxxxxx>
    Reviewed-by: Andrey Konovalov <andreyknvl@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20240814091005.969756-1-samuel.holland@xxxxxxxxxx
    Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 417a8a86b2db5..c583d1f335f8c 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -371,9 +371,6 @@ void __init __no_sanitize_address setup_arch(char **cmdline_p)
 	smp_init_cpus();
 	smp_build_mpidr_hash();
 
-	/* Init percpu seeds for random tags after cpus are set up. */
-	kasan_init_sw_tags();
-
 #ifdef CONFIG_ARM64_SW_TTBR0_PAN
 	/*
 	 * Make sure init_thread_info.ttbr0 always generates translation
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 960b98b43506d..14365ef842440 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -459,6 +459,8 @@ void __init smp_prepare_boot_cpu(void)
 		init_gic_priority_masking();
 
 	kasan_init_hw_tags();
+	/* Init percpu seeds for random tags after cpus are set up. */
+	kasan_init_sw_tags();
 }
 
 /*




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux