WSL2-Linux-Kernel/arch/arm
Florian Fainelli 30dc2effc7 ARM: 9216/1: Fix MAX_DMA_ADDRESS overflow
[ Upstream commit fb0fd3469e ]

Commit 26f09e9b3a ("mm/memblock: add memblock memory allocation apis")
added a check to determine whether arm_dma_zone_size is exceeding the
amount of kernel virtual address space available between the upper 4GB
virtual address limit and PAGE_OFFSET in order to provide a suitable
definition of MAX_DMA_ADDRESS that should fit within the 32-bit virtual
address space. The quantity used for comparison was off by a missing
trailing 0, leading to MAX_DMA_ADDRESS to be overflowing a 32-bit
quantity.

This was caught thanks to CONFIG_DEBUG_VIRTUAL on the bcm2711 platform
where we define a dma_zone_size of 1GB and we have a PAGE_OFFSET value
of 0xc000_0000 (CONFIG_VMSPLIT_3G) leading to MAX_DMA_ADDRESS being
0x1_0000_0000 which overflows the unsigned long type used throughout
__pa() and then __virt_addr_valid(). Because the virtual address passed
to __virt_addr_valid() would now be 0, the function would loudly warn
and flood the kernel log, thus making the platform unable to boot
properly.

Fixes: 26f09e9b3a ("mm/memblock: add memblock memory allocation apis")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-03 12:03:55 +02:00
..
boot ARM: dts: stm32: use the correct clock source for CEC on stm32mp151 2022-07-21 21:24:40 +02:00
common ARM: sharpsl_param: work around -Wstringop-overread warning 2021-10-05 15:44:56 +02:00
configs ARM: mxs_defconfig: Enable the framebuffer 2022-07-12 16:35:12 +02:00
crypto lib/crypto: blake2s: avoid indirect calls to compression function for Clang CFI 2022-05-30 09:28:59 +02:00
include ARM: 9216/1: Fix MAX_DMA_ADDRESS overflow 2022-08-03 12:03:55 +02:00
kernel signal: Deliver SIGTRAP on perf event asynchronously if blocked 2022-06-09 10:22:48 +02:00
lib ARM: crypto: comment out gcc warning that breaks clang builds 2022-08-03 12:03:54 +02:00
mach-actions
mach-alpine
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 ARM: at91: pm: use proper compatibles for sama7g5's rtc and rtt 2022-07-12 16:35:14 +02:00
mach-axxia ARM: Fix refcount leak in axxia_boot_secondary 2022-06-29 09:03:31 +02:00
mach-bcm
mach-berlin
mach-clps711x
mach-cns3xxx ARM: cns3xxx: Fix refcount leak in cns3xxx_init 2022-06-29 09:03:31 +02:00
mach-davinci ARM: davinci: da850-evm: Avoid NULL pointer dereference 2022-04-20 09:34:20 +02:00
mach-digicolor
mach-dove ARM: dove: mark 'putc' as inline 2021-10-05 15:40:38 +02:00
mach-ep93xx
mach-exynos ARM: exynos: Fix refcount leak in exynos_map_pmu 2022-06-29 09:03:30 +02:00
mach-footbridge
mach-gemini
mach-highbank
mach-hisi ARM: hisi: Add missing of_node_put after of_find_compatible_node 2022-06-09 10:22:42 +02:00
mach-imx ARM: imx: register reset controller from a platform driver 2021-10-15 09:38:06 +08:00
mach-integrator
mach-iop32x ARM: iop32x: offset IRQ numbers by 1 2022-04-08 14:24:11 +02:00
mach-ixp4xx ARM: SoC updates for 5.15 2021-09-01 15:19:43 -07:00
mach-keystone
mach-lpc18xx
mach-lpc32xx
mach-mediatek arm: mediatek: select arch timer for mt7629 2022-06-09 10:23:07 +02:00
mach-meson ARM: meson: Fix refcount leak in meson_smp_prepare_cpus 2022-07-12 16:35:11 +02:00
mach-milbeaut
mach-mmp ARM: mmp: Fix failure to remove sram device 2022-04-08 14:24:02 +02:00
mach-moxart
mach-mstar ARM: mstar: Select HAVE_ARM_ARCH_TIMER 2022-04-08 14:22:46 +02:00
mach-mv78xx0
mach-mvebu
mach-mxs
mach-nomadik
mach-npcm
mach-nspire
mach-omap1 ARM: OMAP1: clock: Fix UART rate reporting algorithm 2022-06-09 10:22:42 +02:00
mach-omap2 ARM: OMAP2+: Fix refcount leak in omap_gic_of_init 2022-05-09 09:14:32 +02:00
mach-orion5x
mach-oxnas
mach-pxa ARM: pxa: maybe fix gpio lookup tables 2022-06-09 10:23:29 +02:00
mach-qcom
mach-rda
mach-realtek
mach-realview
mach-rockchip
mach-rpc printk changes for 5.15 2021-09-01 18:41:13 -07:00
mach-s3c ARM: 9187/1: JIVE: fix return value of __setup handler 2022-04-08 14:24:13 +02:00
mach-s5pv210
mach-sa1100
mach-shmobile ARM: shmobile: rcar-gen2: Add missing of_node_put() 2022-01-27 11:04:25 +01:00
mach-socfpga ARM: socfpga: fix missing RESET_CONTROLLER 2022-02-16 12:56:19 +01:00
mach-spear
mach-sti
mach-stm32
mach-sunxi
mach-tegra ARM: SoC drivers for 5.15 2021-09-01 15:25:28 -07:00
mach-uniphier
mach-ux500
mach-versatile
mach-vexpress ARM: versatile: Add missing of_node_put in dcscb_init 2022-06-09 10:22:42 +02:00
mach-vt8500
mach-zynq
mm ARM: 9210/1: Mark the FDT_FIXED sections as shareable 2022-07-21 21:24:16 +02:00
net bpf, arm: Fix register clobbering in div/mod implementation 2021-09-29 16:04:50 +02:00
nwfpe
plat-omap
plat-orion
plat-pxa
plat-versatile
probes ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction 2022-07-21 21:24:12 +02:00
tools ARM development updates for 5.15: 2021-09-09 13:25:49 -07:00
vdso
vfp
xen xen/arm: Fix race in RB-tree based P2M accounting 2022-07-07 17:53:32 +02:00
Kbuild
Kconfig kmap_local: don't assume kmap PTEs are linear arrays in memory 2021-11-25 09:48:43 +01:00
Kconfig-nommu
Kconfig.assembler
Kconfig.debug ARM: imx: rename DEBUG_IMX21_IMX27_UART to DEBUG_IMX27_UART 2022-01-27 11:04:29 +01:00
Makefile ARM: 9156/1: drop cc-option fallbacks for architecture selection 2021-11-18 19:17:13 +01:00