TencentOS-kernel/arch/arm64/kernel
Bill Wendling 0cdfbef3c3 arm64/vdso: Discard .note.gnu.property sections in vDSO
[ Upstream commit 388708028e6937f3fc5fc19aeeb847f8970f489c ]

The arm64 assembler in binutils 2.32 and above generates a program
property note in a note section, .note.gnu.property, to encode used x86
ISAs and features. But the kernel linker script only contains a single
NOTE segment:

  PHDRS
  {
    text    PT_LOAD    FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
    dynamic PT_DYNAMIC FLAGS(4);               /* PF_R */
    note    PT_NOTE    FLAGS(4);               /* PF_R */
  }

The NOTE segment generated by the vDSO linker script is aligned to 4 bytes.
But the .note.gnu.property section must be aligned to 8 bytes on arm64.

  $ readelf -n vdso64.so

  Displaying notes found in: .note
    Owner                Data size      Description
    Linux                0x00000004     Unknown note type: (0x00000000)
     description data: 06 00 00 00
  readelf: Warning: note with invalid namesz and/or descsz found at offset 0x20
  readelf: Warning:  type: 0x78, namesize: 0x00000100, descsize: 0x756e694c, alignment: 8

Since the note.gnu.property section in the vDSO is not checked by the
dynamic linker, discard the .note.gnu.property sections in the vDSO.

Similar to commit 4caffe6a28d31 ("x86/vdso: Discard .note.gnu.property
sections in vDSO"), but for arm64.

Signed-off-by: Bill Wendling <morbo@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20210423205159.830854-1-morbo@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-20 16:07:33 +08:00
..
probes arm64: uprobe: Return EOPNOTSUPP for AARCH32 instruction probing 2021-04-12 12:52:37 +08:00
vdso arm64/vdso: Discard .note.gnu.property sections in vDSO 2021-05-20 16:07:33 +08:00
vdso32 ARM64: vdso32: Install vdso32 from vdso_install 2021-03-16 16:34:40 +08:00
.gitignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
acpi.c arm64: acpi: Make apei_claim_sea() synchronise with APEI's irq work 2021-03-16 16:37:19 +08:00
acpi_numa.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
acpi_parking_protocol.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
alternative.c arm64/alternatives: don't patch up internal branches 2021-03-16 16:31:49 +08:00
armv8_deprecated.c arm64: armv8_deprecated: Fix undef_hook mask for thumb setend 2021-03-16 16:26:13 +08:00
asm-offsets.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cacheinfo.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cpu-reset.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cpu-reset.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cpu_errata.c arm64: Run ARCH_WORKAROUND_2 enabling code on all CPUs 2021-03-16 16:39:28 +08:00
cpu_ops.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cpufeature.c KVM: arm64: Hide system instruction access to Trace registers 2021-05-20 16:07:05 +08:00
cpuidle.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cpuinfo.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
crash_core.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
crash_dump.c arm64: kdump: update ppos when reading elfcorehdr 2021-04-12 12:53:30 +08:00
debug-monitors.c arm64: Use test_tsk_thread_flag() for checking TIF_SINGLESTEP 2021-03-16 16:32:33 +08:00
efi-entry.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
efi-header.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
efi-rt-wrapper.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
efi.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
entry-fpsimd.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
entry-ftrace.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
entry.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
fpsimd.c arm64: sve: Fix build failure when ARM64_SVE=y and SYSCTL=n 2021-03-16 16:31:05 +08:00
ftrace.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
head.S arm64: mm: use a 48-bit ID map when possible on 52-bit VA builds 2021-04-12 12:53:11 +08:00
hibernate-asm.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hibernate.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hw_breakpoint.c arm64: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints 2021-03-16 16:30:39 +08:00
hyp-stub.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
image-vars.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
image.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
insn.c arm64: insn: Fix two bugs in encoding 32-bit logical immediates 2021-03-16 16:29:18 +08:00
io.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
irq.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
jump_label.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
kaslr.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
kexec_image.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
kgdb.c arm64: kgdb: Fix single-step exception handling oops 2021-03-16 16:31:32 +08:00
kuser32.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
machine_kexec.c arm64: fix the flush_icache_range arguments in machine_kexec 2021-03-16 16:27:55 +08:00
machine_kexec_file.c arm64: kexec_file: fix memory leakage in create_dtb() when fdt_open_into() fails 2021-04-12 12:52:37 +08:00
module-plts.c arm64/module: set trampoline section flags regardless of CONFIG_DYNAMIC_FTRACE 2021-03-16 16:35:59 +08:00
module.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
module.lds arm64 module: set plt* section addresses to 0x0 2021-04-12 12:52:43 +08:00
paravirt.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pci.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
perf_callchain.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
perf_event.c arm64: perf: Correct the event index in sysfs 2021-03-16 16:34:03 +08:00
perf_regs.c arm64: perf: Report the PC value in REGS_ABI_32 mode 2021-03-16 16:31:10 +08:00
pointer_auth.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
process.c arm64: errata: Fix handling of 1418040 with late CPU onlining 2021-03-16 16:41:10 +08:00
processor-type.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
psci.c arm64: psci: Avoid printing in cpu_psci_cpu_die() 2021-03-16 16:41:10 +08:00
ptrace.c arm64: ptrace: Fix seccomp of traced syscall -1 (NO_SYSCALL) 2021-04-12 12:52:52 +08:00
reloc_test_core.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
reloc_test_syms.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
relocate_kernel.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
return_address.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sdei.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
setup.c arm64: Fix __cpu_logical_map undefined issue 2021-03-16 16:34:54 +08:00
signal.c arm64: ptrace: Consistently use pseudo-singlestep exceptions 2021-03-16 16:32:15 +08:00
signal32.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sigreturn32.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sleep.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
smccc-call.S Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
smp.c arm64: smp: Tell RCU about CPUs that fail to come online 2021-03-16 16:41:11 +08:00
smp_spin_table.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ssbd.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
stacktrace.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
suspend.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sys.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sys32.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sys_compat.c arm64: Silence clang warning on mismatched value/register sizes 2021-03-16 16:26:43 +08:00
syscall.c arm64: syscall: exit userspace before unmasking exceptions 2021-03-16 16:42:29 +08:00
time.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
topology.c arm64: topology: Stop using MPIDR for topology information 2021-03-16 16:39:45 +08:00
trace-events-emulation.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
traps.c arm64: Fake the IminLine size on systems affected by Neoverse-N1 #1542419 2021-03-16 16:26:43 +08:00
vdso.c arm64: vdso: don't free unallocated pages 2021-03-16 16:26:25 +08:00
vmlinux.lds.S KVM: arm64: Add kvm_extable for vaxorcism code 2021-03-16 16:35:21 +08:00