openwrt/target/linux/realtek
Markus Stockhausen 0724412c58
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
realtek: RTL838x harden ethernet driver against fuzzying
While checking setup routines for stability and completeness,
random RTL838x SoC I/O areas were intentionally overwritten.
As soon as L2_CTRL_1->FAST_AGE_OUT is set to 1, the system
stalls during bootup. Analysis shows that it loops endlessly
in rtl838x_hw_stop()

/* Flush L2 address cache */
if (priv->family_id == RTL8380_FAMILY_ID) {
	for (int i = 0; i <= priv->cpu_port; i++) {
		sw_w32(1 << 26 | 1 << 23 | i << 5, priv->r->l2_tbl_flush_ctrl);
		do { } while (sw_r32(priv->r->l2_tbl_flush_ctrl) & (1 << 26));
	}

This is exactly the same logic as in the vendor GPL. There
are no hints about possible timeouts or issues. The reason is
still unclear. Nevertheless harden the function for further fuzzy
tests. Do this by resetting the configuration value to its SoC
default.

Additionally convert some shifts to BIT() for better readability.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19679
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-11 15:18:09 +02:00
..
base-files realtek: add support for TP-Link TL-ST1008F v2.0 2025-06-16 13:30:52 +02:00
dts realtek: use consistent definition in DTS for SFP(+) ports 2025-08-07 13:47:27 +02:00
files/firmware/rtl838x_phy
files-6.12 realtek: RTL838x harden ethernet driver against fuzzying 2025-08-11 15:18:09 +02:00
image realtek: switch Netgear NGE devices to rt-loader 2025-08-11 10:38:13 +02:00
patches-6.12 realtek: fix stall after restart of otto timer 2025-08-10 22:02:47 +02:00
profiles target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00
rtl838x realtek: backport NAND driver for RTL93xx 2025-07-30 23:22:24 +02:00
rtl839x realtek: backport NAND driver for RTL93xx 2025-07-30 23:22:24 +02:00
rtl930x realtek: add NAND targets for RTL93xx 2025-08-10 11:46:52 +02:00
rtl930x_nand realtek: add NAND targets for RTL93xx 2025-08-10 11:46:52 +02:00
rtl931x realtek: add NAND targets for RTL93xx 2025-08-10 11:46:52 +02:00
rtl931x_nand realtek: add NAND targets for RTL93xx 2025-08-10 11:46:52 +02:00
Makefile realtek: add NAND targets for RTL93xx 2025-08-10 11:46:52 +02:00