WSL2-Linux-Kernel/arch/arm64/kernel
Samuel Holland 5750e353e6 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: 3c9e3aa110 ("kasan: add tag related helper functions")
Fixes: 3f41b60938 ("kasan: fix random seed generation for tag-based mode")
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Link: https://lore.kernel.org/r/20240814091005.969756-1-samuel.holland@sifive.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-04 13:23:23 +02:00
..
probes kprobes: treewide: Cleanup the error messages for kprobes 2023-02-22 12:57:00 +01:00
vdso arm64: vdso: fix makefile dependency on vdso.so 2022-05-18 10:26:50 +02:00
vdso32 arm64: vdso: fix makefile dependency on vdso.so 2022-05-18 10:26:50 +02:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Makefile arm64: vdso: fix makefile dependency on vdso.so 2022-05-18 10:26:50 +02:00
acpi.c Revert "ACPI: Add memory semantics to acpi_os_map_memory()" 2021-09-23 20:39:36 +02:00
acpi_numa.c arm64: ACPI: NUMA: initialize all values of acpi_early_node_map to NUMA_NO_NODE 2024-09-04 13:23:16 +02:00
acpi_parking_protocol.c arm64: use function_nocfi with __pa_symbol 2021-04-08 16:04:22 -07:00
alternative.c arm64: alternatives: mark patch_alternative() as `noinstr` 2022-04-20 09:34:16 +02:00
armv8_deprecated.c arm64: armv8_deprecated: Fix warning in isndep cpuhp starting process 2024-07-27 10:46:09 +02:00
asm-offsets.c arm64: mte: rename gcr_user_excl to mte_ctrl 2021-07-28 18:33:19 +01:00
cacheinfo.c arm64: cacheinfo: Fix incorrect assignment of signed error value to unsigned fw_level 2022-09-15 11:30:01 +02:00
cpu-reset.S arm64: Use INIT_SCTLR_EL1_MMU_OFF to disable the MMU on CPU restart 2021-03-18 15:51:07 +00:00
cpu-reset.h arm64: add __nocfi to functions that jump to a physical address 2021-04-08 16:04:22 -07:00
cpu_errata.c arm64: errata: Expand speculative SSBS workaround (again) 2024-08-19 05:45:41 +02:00
cpu_ops.c arm64: Introduce get_cpu_ops() helper function 2020-03-24 17:24:19 +00:00
cpufeature.c arm64: cpufeature: Fix the visibility of compat hwcaps 2024-08-19 05:45:51 +02:00
cpuidle.c cpuidle: PSCI: Move the `has_lpi` check to the beginning of the function 2022-04-20 09:34:04 +02:00
cpuinfo.c arm64: cpufeature: add HWCAP for FEAT_RPRES 2022-03-11 12:22:33 +01:00
crash_core.c arm64/crash_core: Export TCR_EL1.T1SZ in vmcoreinfo 2020-07-02 17:56:49 +01:00
crash_dump.c arm64: kdump: update ppos when reading elfcorehdr 2021-03-22 12:46:38 +00:00
debug-monitors.c arm64: kgdb: Set PSTATE.SS to 1 to re-enable single-step 2023-05-11 23:00:24 +09:00
efi-entry.S arm64: Rename arm64-internal cache maintenance functions 2021-05-25 19:27:49 +01:00
efi-header.S arm64: head: tidy up the Image header definition 2020-11-17 16:14:20 +00:00
efi-rt-wrapper.S efi: rt-wrapper: Add missing include 2023-01-24 07:22:48 +01:00
efi.c arm64: efi: Make efi_rt_lock a raw_spinlock 2023-03-17 08:48:51 +01:00
entry-common.c arm64: split EL0/EL1 UNDEF handlers 2023-10-19 23:05:38 +02:00
entry-fpsimd.S arm64/sve: Add some comments for sve_save/load_state() 2021-08-24 16:44:23 +01:00
entry-ftrace.S arm64: ftrace: add missing BTIs 2021-12-08 09:04:47 +01:00
entry.S arm64: sdei: abort running SDEI handlers during crash 2023-09-19 12:22:52 +02:00
fpsimd.c arm64: Treat ESR_ELx as a 64-bit register 2022-12-31 13:13:58 +01:00
ftrace.c arm64: ftrace: fix module PLTs with mcount 2022-10-26 12:35:01 +02:00
head.S arm64: Always load shadow stack pointer directly from the task struct 2023-05-11 23:00:15 +09:00
hibernate-asm.S arm64: Rename arm64-internal cache maintenance functions 2021-05-25 19:27:49 +01:00
hibernate.c Revert "arm64: kasan: Revert "arm64: mte: reset the page tag in page->flags"" 2022-09-15 11:30:07 +02:00
hw_breakpoint.c hw_breakpoint: fix single-stepping when using bpf_overflow_handler 2023-09-23 11:09:55 +02:00
hyp-stub.S Merge remote-tracking branch 'arm64/for-next/vhe-only' into kvmarm-master/next 2021-04-13 15:42:40 +01:00
idle.c Merge branch 'for-next/entry' into for-next/core 2021-06-24 14:01:55 +01:00
idreg-override.c arm64/cpufeature: Optionally disable MTE via command-line 2021-08-03 15:48:01 +01:00
image-vars.h arm64: Use the clearbhb instruction in mitigations 2022-03-11 12:22:35 +01:00
image.h arm64: get rid of TEXT_OFFSET 2020-09-07 15:00:52 +01:00
io.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
irq.c arm64: irq: set the correct node for shadow call stack 2024-02-23 08:54:55 +01:00
jump_label.c arm64: insn: decouple patching from insn code 2021-06-11 11:19:27 +01:00
kaslr.c arm64: fix the doc of RANDOMIZE_MODULE_REGION_FULL 2021-08-03 10:36:42 +01:00
kexec_image.c arm64: kexec_file: Fix sparse warning 2020-11-10 13:11:44 +00:00
kgdb.c arm64: kgdb: Set PSTATE.SS to 1 to re-enable single-step 2023-05-11 23:00:24 +09:00
kuser32.S docs: arm: convert docs to ReST and rename to *.rst 2019-07-15 09:20:24 -03:00
machine_kexec.c set_memory: allow querying whether set_direct_map_*() is actually enabled 2021-07-08 11:48:20 -07:00
machine_kexec_file.c arm64: kexec: Fix missing error code 'ret' warning in load_other_segments() 2021-12-22 09:32:45 +01:00
module-plts.c arm64: module: Use module_init_layout_section() to spot init sections 2023-09-02 09:17:07 +02:00
module.c mm: defer kmemleak object creation of module_alloc() 2022-03-08 19:12:38 +01:00
mte.c arm64: mte: Avoid setting PG_mte_tagged if no tags cleared or restored 2022-12-08 11:28:37 +01:00
paravirt.c arm64: paravirt: Use RCU read locks to guard stolen_time 2022-05-25 09:57:28 +02:00
patching.c arm64: patch_text: Fixup last cpu should be master 2022-04-13 20:59:23 +02:00
pci.c arm64: PCI: Support root bridge preparation for Hyper-V 2021-08-23 10:59:26 +01:00
perf_callchain.c perf: Protect perf_guest_cbs with RCU 2022-01-20 09:13:14 +01:00
perf_event.c drivers/perf: pmuv3: don't expose SW_INCR event in sysfs 2024-02-23 08:54:36 +01:00
perf_regs.c perf/arch: Remove perf_sample_data::regs_user_copy 2020-11-09 18:12:34 +01:00
pointer_auth.c arm64: move preemption disablement to prctl handlers 2021-07-28 18:33:49 +01:00
process.c arm64: errata: Fix exec handling in erratum 1418040 workaround 2022-01-27 11:02:58 +01:00
proton-pack.c arm64: errata: Unify speculative SSBS errata logic 2024-08-19 05:45:41 +02:00
psci.c arm64: use function_nocfi with __pa_symbol 2021-04-08 16:04:22 -07:00
ptrace.c Merge remote-tracking branch 'tip/sched/arm64' into for-next/core 2021-08-31 09:10:00 +01:00
reloc_test_core.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
reloc_test_syms.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
relocate_kernel.S arm64: kexec: arm64_relocate_new_kernel don't use x0 as temp 2021-01-27 15:41:12 +00:00
return_address.c arm64: stacktrace: Make stack walk callback consistent with generic code 2020-09-18 14:24:16 +01:00
sdei.c arm64: sdei: abort running SDEI handlers during crash 2023-09-19 12:22:52 +02:00
setup.c arm64: Fix KASAN random tag seed initialization 2024-09-04 13:23:23 +02:00
signal.c signal: Deliver SIGTRAP on perf event asynchronously if blocked 2022-06-09 10:22:48 +02:00
signal32.c signal: Deliver SIGTRAP on perf event asynchronously if blocked 2022-06-09 10:22:48 +02:00
sigreturn32.S
sleep.S kasan: remove redundant config option 2021-04-16 16:10:36 -07:00
smccc-call.S arm64: smccc: Save lr before calling __arm_smccc_sve_check() 2021-07-21 11:23:25 +01:00
smp.c arm64: Fix KASAN random tag seed initialization 2024-09-04 13:23:23 +02:00
smp_spin_table.c arm64: Rename arm64-internal cache maintenance functions 2021-05-25 19:27:49 +01:00
stacktrace.c arm64: Mark start_backtrace() notrace and NOKPROBE_SYMBOL 2022-03-08 19:12:32 +01:00
suspend.c arm64: mte: move register initialization to C 2022-10-29 10:12:57 +02:00
sys.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
sys32.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 452 2019-06-19 17:09:08 +02:00
sys_compat.c arm64: compat: Do not treat syscall number as ESR_ELx for a bad syscall 2022-06-09 10:22:35 +02:00
syscall.c arm64: fix compat syscall return truncation 2021-08-03 10:35:03 +01:00
time.c arm64: time: Replace <linux/clk-provider.h> by <linux/of_clk.h> 2020-02-12 17:26:38 +00:00
topology.c arm64: topology: move store_cpu_topology() to shared code 2022-10-26 12:34:22 +02:00
trace-events-emulation.h
traps.c arm64: armv8_deprecated: rework deprected instruction handling 2023-10-19 23:05:38 +02:00
vdso-wrap.S arm64: do not descend to vdso directories twice 2021-01-20 12:18:46 +00:00
vdso.c arm64: vdso: Pass (void *) to virt_to_page() 2023-06-09 10:32:25 +02:00
vdso32-wrap.S arm64: do not descend to vdso directories twice 2021-01-20 12:18:46 +00:00
vmlinux.lds.S arm64: entry: Allow the trampoline text to occupy multiple pages 2022-03-11 12:22:34 +01:00