linux-stable/arch/arm64
Bill Wendling 7331bcd2a3 arm64/vdso: Discard .note.gnu.property sections in vDSO
[ Upstream commit 388708028e ]

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 4caffe6a28 ("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-22 10:57:21 +02:00
..
boot arm64: dts: mt8173: fix property typo of 'phys' in dsi node 2021-05-22 10:57:14 +02:00
configs arm64: defconfig: Enable Rockchip io-domain driver 2018-08-03 07:50:38 +02:00
crypto crypto: arm64/sha2-ce - correct digest for empty data in finup 2019-07-31 07:28:35 +02:00
include arm64: alternatives: Move length validation in alternative_{insn, endif} 2021-04-28 12:08:41 +02:00
kernel arm64/vdso: Discard .note.gnu.property sections in vDSO 2021-05-22 10:57:21 +02:00
kvm KVM: arm64: Disable guest access to trace filter controls 2021-04-16 11:57:53 +02:00
lib arm64: lib: use C string functions with KASAN enabled 2019-12-01 09:13:48 +01:00
mm arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE 2020-11-05 11:06:56 +01:00
net bpf: get rid of pure_initcall dependency to enable jits 2019-08-25 10:50:02 +02:00
xen arm64: kpti: Fix the interaction between ASID switching and software PAN 2018-02-16 20:22:49 +01:00
Kconfig arm64: enable generic CPU vulnerabilites support 2019-10-29 09:17:26 +01:00
Kconfig.debug
Kconfig.platforms arm64: berlin: Select DW_APB_TIMER_OF 2020-11-05 11:07:04 +01:00
Makefile arm64: link with -z norelro regardless of CONFIG_RELOCATABLE 2020-11-05 11:06:51 +01:00