immortalwrt/package/boot
Mathias Kresin e7574b49c7 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-12-02 00:03:43 +08:00
..
arm-trusted-firmware-mediatek arm-trusted-firmware-mediatek: update to git HEAD 2021-05-09 20:49:53 +08:00
arm-trusted-firmware-mvebu arm-trusted-firmware-mvebu: Add hash for aarch64 cm3-gcc 2021-09-21 23:50:49 +08:00
arm-trusted-firmware-rockchip atf-rockchip: update to 2.3 2020-07-18 13:24:44 +08:00
arm-trusted-firmware-rockchip-vendor arm-trusted-firmware-rockchip-vendor: workaround for VARIANT issue 2021-08-13 00:36:15 +08:00
arm-trusted-firmware-sunxi sunxi: add support for OrangePi 3 2021-06-20 13:12:45 +08:00
arm-trusted-firmware-tools arm-trusted-firmware-tools: add patch to pass LDFLAGS 2021-02-11 12:09:41 +08:00
at91bootstrap at91bootstrap: Fix compile with binutils 2.36 2021-08-21 12:15:52 +08:00
aw-el2-barebone sunxi: add support for OrangePi 3 2021-06-20 13:12:45 +08:00
fconfig treewide: unify OpenWrt hosted source via @OPENWRT 2021-02-08 12:11:32 +08:00
grub2 grub2: update to 2.06 2021-06-22 15:35:29 +08:00
imx-bootlets imx-bootlets: refresh patches 2021-02-25 12:02:55 +08:00
kexec-tools kexec-tools: add patch to fix issue with appended DTB and zImage on ARM 2021-05-23 23:28:54 +08:00
kobs-ng fix & merge 2019-09-30 13:21:19 +08:00
mt7623n-preloader mediatek: mt7623n-preloader: add preloader for Banana Pi R64 2020-09-20 11:36:49 +08:00
tfa-layerscape tfp-layerscape: update to LSDK-20.12 2021-09-23 23:48:05 +08:00
uboot-at91 treewide: use AUTORELEASE on all uboot-* packages 2021-10-09 00:13:30 +08:00
uboot-envtools ath79: add support for Dongwon T&I DW02-412H 2021-11-20 00:10:22 +08:00
uboot-fritz4040 treewide: use AUTORELEASE on all uboot-* packages 2021-10-09 00:13:30 +08:00
uboot-imx6 treewide: use AUTORELEASE on all uboot-* packages 2021-10-09 00:13:30 +08:00
uboot-kirkwood uboot-kirkwood: refresh patches 2021-06-07 23:25:28 +08:00
uboot-lantiq uboot-lantiq: fix out of bounds cache invalidate 2021-12-02 00:03:43 +08:00
uboot-layerscape uboot-layerscape: fix dtc compilation on host gcc 10 2021-08-09 12:10:23 +08:00
uboot-mediatek u-boot.mk: fix pkg-config usage 2021-10-28 23:56:57 +08:00
uboot-mvebu u-boot.mk: always link host libraries static 2021-10-28 23:57:23 +08:00
uboot-mxs u-boot.mk: always link host libraries static 2021-10-28 23:57:23 +08:00
uboot-omap uboot-omap: Remove omap3_overo configuration 2021-12-01 23:48:09 +08:00
uboot-oxnas treewide: use AUTORELEASE on all uboot-* packages 2021-10-09 00:13:30 +08:00
uboot-rockchip treewide: use AUTORELEASE on all uboot-* packages 2021-10-09 00:13:30 +08:00
uboot-sunxi Merge Mainline 2021-10-27 12:18:41 +08:00
uboot-tegra treewide: use AUTORELEASE on all uboot-* packages 2021-10-09 00:13:30 +08:00
uboot-zynq u-boot.mk: always link host libraries static 2021-10-28 23:57:23 +08:00