]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: dsa: avoid use-after-free
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Sun, 11 Jan 2026 19:31:20 +0000 (20:31 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 8 Feb 2026 20:25:29 +0000 (21:25 +0100)
commitdec360a3ac7078046bb789d29244b70776d113e1
tree7da2cc3889a564bb364d4be1dc22d0a367378b61
parent8c895dc4c5be7c76b200b45818811d5aa4de59bb
realtek: dsa: avoid use-after-free

The realtek target uses some functions marked __init for initialization.
However, that means they can only be called once when compiled in and
afterwards the memory occupied by them is freed and potentially reused.
Some "impossible" (code at a given location can't crash in the way it
does) crashes can be caused by this because upon re-execution of those
functions, garbage gets executed. Such re-execution can happen for
deferred probes or repeated probes.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Link: https://github.com/openwrt/openwrt/pull/21504
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit a91c3abe83c3f9513518c86b5d0a42b5a9afaad3)
Link: https://github.com/openwrt/openwrt/pull/21900
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c