u-boot-brain/board/Marvell
Pali Rohár 48f2c8a37f arm: mvebu: Espressobin: Disallow forwarding packets between wan and lan ports
By default Topaz switch on Espressobin board forwards packets between all
ethernet ports, including CPU (port 0), wan (port 1) and lan (ports 2,3).

This default U-Boot setup is unsuitable for using Espressobin as router as
it opens security hole in forwarding all packets between wan and lan ports.
E.g. dhcp packets from wan network leaks to lan network during small time
window until U-Boot boots Linux kernel which loads network drivers which
disallows forwarding between wan and lan.

This patch fixes above problem. For Espressobin board prior putting Topaz
switch into forwarding mode, Topaz switch is reconfigured to allow
forwarding packets from wan and lan ports only to CPU port. This ensures
that packets from wan port are not forwarded to lan ports and vice-versa.
Packets from CPU port are still forwarded to all other ports, so U-Boot
network boot works with any ethernet port as before.

This problem was already discussed on Espressobin forum [1] and on
Marvell's github issue tracker [2]. As a workaround people on Espressobin
forum patched U-Boot to completely disable lan ports on Topaz switch which
prevented forwarding packets. That workaround had an issue that U-Boot was
unable to netboot via lan ports anymore. Change in this patch does not have
such issue.

This security issue has been dicussed here as well: [3].

[1] - https://web.archive.org/web/20191231164238/http://espressobin.net/forums/topic/boot-behavior-of-the-switch-and-security/
[2] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/issues/18
[3] - https://forum.armbian.com/topic/12635-espressobin-uboot-security-concerns-switch-init-portmask/

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
2020-08-31 14:44:14 +02:00
..
aspenite common: Drop init.h from common header 2020-05-18 17:33:33 -04:00
db-88f6281-bp common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
db-88f6720 treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
db-88f6820-amc treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
db-88f6820-gp treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
db-mv784mp-gp treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
db-xc3-24g4xg common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
dreamplug common: Drop init.h from common header 2020-05-18 17:33:33 -04:00
gplugd treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
guruplug common: Drop init.h from common header 2020-05-18 17:33:33 -04:00
mvebu_armada-8k common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
mvebu_armada-37xx arm: mvebu: Espressobin: Disallow forwarding packets between wan and lan ports 2020-08-31 14:44:14 +02:00
octeon_ebb7304 mips: octeon: Add minimal Octeon 3 EBB7304 EVK support 2020-07-18 15:47:50 +02:00
octeontx arm: octeontx: Add support for OcteonTX SoC platforms 2020-08-25 08:01:16 +02:00
octeontx2 arm: octeontx2: Add support for OcteonTX2 SoC platforms 2020-08-25 08:01:16 +02:00
openrd common: Drop init.h from common header 2020-05-18 17:33:33 -04:00
sheevaplug common: Drop init.h from common header 2020-05-18 17:33:33 -04:00