linux/arch/arm
Ard Biesheuvel c4e792d1ac ARM: 9056/1: decompressor: fix BSS size calculation for LLVM ld.lld
The LLVM ld.lld linker uses a different symbol type for __bss_start,
resulting in the calculation of KBSS_SZ to be thrown off. Up until now,
this has gone unnoticed as it only affects the appended DTB case, but
pending changes for ARM in the way the decompressed kernel is cleaned
from the caches has uncovered this problem.

On a ld.lld build:

  $ nm vmlinux |grep bss_
  c1c22034 D __bss_start
  c1c86e98 B __bss_stop

resulting in

  $ readelf -s arch/arm/boot/compressed/vmlinux | grep bss_size
  433: c1c86e98     0 NOTYPE  GLOBAL DEFAULT  ABS _kernel_bss_size

which is obviously incorrect, and may cause the cache clean to access
unmapped memory, or cause the size calculation to wrap, resulting in no
cache clean to be performed at all.

Fix this by updating the sed regex to take D type symbols into account.

Link: https://lore.kernel.org/linux-arm-kernel/6c65bcef-d4e7-25fa-43cf-2c435bb61bb9@collabora.com/
Link: https://lore.kernel.org/linux-arm-kernel/20210205085220.31232-1-ardb@kernel.org/

Cc: <stable@vger.kernel.org> # v4.19+
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Reported-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2021-03-09 10:25:17 +00:00
..
boot ARM: 9056/1: decompressor: fix BSS size calculation for LLVM ld.lld 2021-03-09 10:25:17 +00:00
common ARM: 9049/1: locomo: make locomo bus's remove callback return void 2021-02-01 19:44:30 +00:00
configs Modules updates for v5.12 2021-02-23 10:15:33 -08:00
crypto crypto: arm/blake2b - add NEON-accelerated BLAKE2b 2021-01-03 08:41:39 +11:00
include ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
kernel io_uring-worker.v3-2021-02-25 2021-02-27 08:29:02 -08:00
lib ARM: 9022/1: Change arch/arm/lib/mem*.S to use WEAK instead of .weak 2020-11-12 14:53:19 +00:00
mach-actions
mach-alpine
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 ARM: at91: use proper asm syntax in pm_suspend 2021-02-08 15:54:05 +01:00
mach-axxia
mach-bcm ARM: bcm: Select BRCMSTB_L2_IRQ for bcm2835 2021-01-25 21:59:06 +01:00
mach-berlin
mach-clps711x
mach-cns3xxx
mach-davinci arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2020-12-15 12:13:42 -08:00
mach-digicolor
mach-dove
mach-ep93xx
mach-exynos soc: samsung: exynos-chipid: convert to driver and merge exynos-asv 2021-01-03 17:08:45 +01:00
mach-footbridge ARM: footbridge: fix dc21285 PCI configuration accessors 2021-01-29 11:29:53 +00:00
mach-gemini
mach-highbank arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2020-12-15 12:13:42 -08:00
mach-hisi
mach-imx This is all driver updates, the majority of which is a bunch of new Qualcomm 2021-02-22 09:45:23 -08:00
mach-integrator
mach-iop32x
mach-ixp4xx clocksource/drivers/ixp4xx: Select TIMER_OF when needed 2021-01-18 16:20:15 +01:00
mach-keystone ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson
mach-milbeaut
mach-mmp
mach-moxart
mach-mstar ARM: mstar: SMP support 2020-12-09 17:45:40 +01:00
mach-mv78xx0
mach-mvebu
mach-mxs ARM: mxs: Add serial number support for i.MX23, i.MX28 SoCs 2020-11-30 17:31:29 +08:00
mach-nomadik
mach-npcm
mach-nspire
mach-omap1 Merge branch 'cpuidle-fix' into fixes 2021-01-15 12:48:43 +02:00
mach-omap2 ARM: SoC changes for v5.12 2021-02-20 18:20:06 -08:00
mach-orion5x
mach-oxnas
mach-pxa power supply and reset changes for the v5.12 series 2021-02-22 09:49:59 -08:00
mach-qcom
mach-rda
mach-realtek
mach-realview
mach-rockchip
mach-rpc ARM: rpc: use legacy_timer_tick 2020-10-30 21:57:05 +01:00
mach-s3c ARM: s3c: irq-s3c24xx: staticize local functions 2021-02-08 18:10:21 +01:00
mach-s5pv210 arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2020-12-15 12:13:42 -08:00
mach-sa1100 ARM: 9049/1: locomo: make locomo bus's remove callback return void 2021-02-01 19:44:30 +00:00
mach-shmobile ARM: shmobile: Stop using __raw_*() I/O accessors 2020-11-23 09:54:59 +01:00
mach-socfpga
mach-spear clk: spear: Move prototype to accessible header 2021-02-11 11:56:06 -08:00
mach-sti
mach-stm32
mach-sunxi irqchip/sun6i-r: Use a stacked irqchip driver 2021-01-21 20:21:49 +00:00
mach-tegra ARM: tegra: Don't enable unused PLLs on resume from suspend 2021-01-19 18:20:42 +01:00
mach-uniphier
mach-ux500
mach-versatile
mach-vexpress
mach-vt8500
mach-zynq
mm ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
net bpf: Rename BPF_XADD and prepare to encode other atomics in .imm 2021-01-14 18:34:29 -08:00
nwfpe
plat-omap
plat-orion
plat-pxa
plat-versatile
probes ARM: 9019/1: kprobes: Avoid fortify_panic() when copying optprobe template 2020-10-27 12:11:51 +00:00
tools Kbuild updates for v5.12 2021-02-25 10:17:31 -08:00
vdso ARM: 9051/1: vdso: remove unneded extra-y addition 2021-02-01 19:48:06 +00:00
vfp ARM: 9044/1: vfp: use undef hook for VFP support detection 2020-12-21 11:19:19 +00:00
xen Xen/gnttab: handle p2m update errors on a per-slot basis 2021-03-03 08:32:10 +01:00
Kbuild
Kconfig ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
Kconfig-nommu
Kconfig.assembler
Kconfig.debug ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
Makefile Remove oprofile and dcookies support 2021-02-21 10:40:34 -08:00