original_kernel/arch/arm64/kernel
Peter Collingbourne c4c597f1b3 arm64: mte: Do not set PG_mte_tagged if tags were not initialized
The mte_sync_page_tags() function sets PG_mte_tagged if it initializes
page tags. Then we return to mte_sync_tags(), which sets PG_mte_tagged
again. At best, this is redundant. However, it is possible for
mte_sync_page_tags() to return without having initialized tags for the
page, i.e. in the case where check_swap is true (non-compound page),
is_swap_pte(old_pte) is false and pte_is_tagged is false. So at worst,
we set PG_mte_tagged on a page with uninitialized tags. This can happen
if, for example, page migration causes a PTE for an untagged page to
be replaced. If the userspace program subsequently uses mprotect() to
enable PROT_MTE for that page, the uninitialized tags will be exposed
to userspace.

Fix it by removing the redundant call to set_page_mte_tagged().

Fixes: e059853d14 ("arm64: mte: Fix/clarify the PG_mte_tagged semantics")
Signed-off-by: Peter Collingbourne <pcc@google.com>
Cc: <stable@vger.kernel.org> # 6.1
Link: https://linux-review.googlesource.com/id/Ib02d004d435b2ed87603b858ef7480f7b1463052
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Link: https://lore.kernel.org/r/20230420214327.2357985-1-pcc@google.com
Signed-off-by: Will Deacon <will@kernel.org>
2023-05-16 14:59:16 +01:00
..
pi
probes
vdso
vdso32
.gitignore
Makefile
acpi.c
acpi_numa.c
acpi_parking_protocol.c
alternative.c
armv8_deprecated.c
asm-offsets.c
cacheinfo.c
compat_alignment.c
cpu-reset.S arm64: kernel: remove SHF_WRITE|SHF_EXECINSTR from .idmap.text 2023-05-02 12:42:22 +01:00
cpu_errata.c
cpu_ops.c
cpufeature.c arm64 fixes for -rc1 2023-05-04 12:45:32 -07:00
cpuidle.c
cpuinfo.c
crash_core.c
crash_dump.c
debug-monitors.c
efi-header.S arm64: efi: Enable BTI codegen and add PE/COFF annotation 2023-04-20 15:43:45 +02:00
efi-rt-wrapper.S
efi.c
elfcore.c
entry-common.c
entry-fpsimd.S
entry-ftrace.S
entry.S
fpsimd.c
ftrace.c
head.S arm64: Fix label placement in record_mmu_state() 2023-04-26 09:01:04 +01:00
hibernate-asm.S
hibernate.c
hw_breakpoint.c
hyp-stub.S
idle.c
idreg-override.c Merge branch 'for-next/sysreg' into for-next/core 2023-04-20 18:03:07 +01:00
image-vars.h efi/zboot: arm64: Inject kernel code size symbol into the zboot payload 2023-04-26 18:01:41 +02:00
image.h
io.c
irq.c
jump_label.c
kaslr.c
kexec_image.c
kgdb.c
kuser32.S
machine_kexec.c Merge branch 'for-next/misc' into for-next/core 2023-04-20 11:22:09 +01:00
machine_kexec_file.c
module-plts.c
module.c
mte.c arm64: mte: Do not set PG_mte_tagged if tags were not initialized 2023-05-16 14:59:16 +01:00
paravirt.c
patch-scs.c
patching.c
pci.c
perf_callchain.c
perf_regs.c
pointer_auth.c
process.c Objtool changes for v6.4: 2023-04-28 14:02:54 -07:00
proton-pack.c arm64: delete dead code in this_cpu_set_vectors() 2023-04-20 10:44:54 +01:00
psci.c
ptrace.c
reloc_test_core.c
reloc_test_syms.S
relocate_kernel.S
return_address.c
sdei.c
setup.c
signal.c
signal32.c
sigreturn32.S
sleep.S arm64: kernel: remove SHF_WRITE|SHF_EXECINSTR from .idmap.text 2023-05-02 12:42:22 +01:00
smccc-call.S
smp.c SMP cross-CPU function-call updates for v6.4: 2023-04-28 15:03:43 -07:00
smp_spin_table.c
stacktrace.c
suspend.c
sys.c
sys32.c
sys_compat.c
syscall.c
time.c
topology.c
trace-events-emulation.h
traps.c
vdso-wrap.S
vdso.c arm64: vdso: Pass (void *) to virt_to_page() 2023-05-16 14:53:36 +01:00
vdso32-wrap.S
vmlinux.lds.S arm64: lds: move .got section out of .text 2023-05-02 13:12:45 +01:00