1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-13 10:49:13 +02:00
openwrt/package/boot
Mathias Kresin 87b8f095af uboot-lantiq: fix out of bounds cache invalidate
With gcc10 the variables are placed more tightly to each other, which
uncovers a long existing bug in the lantiq DMA code. It can be observed
when using tftpboot with the filename parameter, which gets reset during
the tftpboot execution.

NetRxPackets[] points to cache line size aligned addresses. In
ltq_eth_rx_packet_align() the address NetRxPackets[] points to is
increased by LTQ_ETH_IP_ALIGN and the resulting not cache aligned
address is used further on. While doing so, the length/size is never
updated.

The "not cache aligned address" + len/size for a cache aligned address
is passed to invalidate_dcache_range(). Hence, invalidate_dcache_range()
invalidates the next 32 bit as well, which flashes the BootFile variable
as well.

   variable BootFile is at address: 0x83ffe12c
   NetRxPackets[] points to 0x83ffdb20 (len is 0x600)
   data points to: 0x83ffdb22 (len is 0x600)

   ltq_dma_dcache_inv: 0x83ffdb22 (for len 0x600)
   invalidate_dcache_range: 0x83ffdb20 to 0x83ffe120 (size: 32)
   invalidate_dcache_range: 0x83ffdb20 to 0x83ffdb40 (Bootfile: a.bin)
   ...
   invalidate_dcache_range: 0x83ffe100 to 0x83ffe120 (Bootfile: a.bin)
   invalidate_dcache_range: 0x83ffe120 to 0x83ffe140 (Bootfile: )

In ltq_dma_tx_map() and ltq_dma_rx_map() the start address passed to
ltq_dma_dcache_wb_inv() is incorrect. By considering the offset, the
start address passed to flush_dcache_range() is always aligned to 32, 64
or 128 bytes dependent on configured DMA burst size.

Fixes: FS#4113

Signed-off-by: Mathias Kresin <dev@kresin.me>
2021-11-14 20:15:35 +01:00
..
arm-trusted-firmware-mediatek arm-trusted-firmware-mediatek: update to git HEAD 2021-05-08 23:27:38 +01:00
arm-trusted-firmware-mvebu arm-trusted-firmware-mvebu: Add hash for aarch64 cm3-gcc 2021-09-20 15:59:47 +02:00
arm-trusted-firmware-rockchip atf-rockchip: update to 2.3 2020-07-28 15:52:44 +02:00
arm-trusted-firmware-sunxi sunxi: add support for H6 boards and OrangePiOnePlus 2021-04-11 23:14:55 +02:00
arm-trusted-firmware-tools arm-trusted-firmware-tools: add patch to pass LDFLAGS 2021-02-10 19:19:18 +00:00
at91bootstrap at91: add support for sam9x60-ek board 2021-10-24 18:52:29 +02:00
fconfig treewide: unify OpenWrt hosted source via @OPENWRT 2021-02-05 12:00:24 -10:00
grub2 grub2: update to 2.06 2021-06-21 09:02:26 -10:00
imx-bootlets imx-bootlets: refresh patches 2021-02-24 16:15:02 +01:00
kexec-tools kexec-tools: add patch to fix issue with appended DTB and zImage on ARM 2021-05-23 15:11:38 +02:00
kobs-ng kobs-ng: update dependencies after 'imx6' -> 'imx' rename 2021-11-03 12:45:40 +01:00
mt7623n-preloader mt7623n-preloader: remove mt7622-preloader 2021-02-28 04:12:23 +00:00
tfa-layerscape tfp-layerscape: update to LSDK-20.12 2021-09-21 21:39:01 -10:00
uboot-at91 at91: add support for sam9x60-ek board 2021-10-24 18:52:29 +02:00
uboot-envtools uboot-envtools: move imx to imx_cortexa9 2021-11-03 12:45:40 +01:00
uboot-fritz4040 treewide: use AUTORELEASE on all uboot-* packages 2021-10-02 21:26:12 +02:00
uboot-imx uboot-imx: set BUILD_SUBTARGET to 'cortexa9' 2021-11-03 12:45:40 +01:00
uboot-kirkwood uboot-kirkwood: refresh patches 2021-06-06 19:06:29 +02:00
uboot-lantiq uboot-lantiq: fix out of bounds cache invalidate 2021-11-14 20:15:35 +01:00
uboot-layerscape uboot-layerscape: fix dtc compilation on host gcc 10 2021-08-09 01:17:04 +02:00
uboot-mediatek u-boot.mk: fix pkg-config usage 2021-10-24 18:00:49 +02:00
uboot-mvebu u-boot.mk: always link host libraries static 2021-10-24 18:00:49 +02:00
uboot-mxs u-boot.mk: always link host libraries static 2021-10-24 18:00:49 +02:00
uboot-omap treewide: use AUTORELEASE on all uboot-* packages 2021-10-02 21:26:12 +02:00
uboot-oxnas treewide: use AUTORELEASE on all uboot-* packages 2021-10-02 21:26:12 +02:00
uboot-ramips treewide: use AUTORELEASE on all uboot-* packages 2021-10-02 21:26:12 +02:00
uboot-rockchip rockchip: rename "Rock Pi 4" to "Rock Pi 4A" 2021-10-10 00:57:56 +02:00
uboot-sunxi uboot-sunxi: add support for FriendlyARM NanoPi R1S H5 2021-10-30 21:17:20 +02:00
uboot-tegra treewide: use AUTORELEASE on all uboot-* packages 2021-10-02 21:26:12 +02:00
uboot-zynq u-boot.mk: always link host libraries static 2021-10-24 18:00:49 +02:00