]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: airoha: Delay offloading until all net_devices are fully registered
authorLorenzo Bianconi <lorenzo@kernel.org>
Sun, 29 Mar 2026 10:32:27 +0000 (12:32 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 31 Mar 2026 00:58:40 +0000 (17:58 -0700)
commitcedc1bf327de62ec30af9743bd1f601c2de30553
treece456df648d1642e0f75d35e7f23a3fb8dd29933
parente6e3eb5ee89ac4c163d46429391c889a1bb5e404
net: airoha: Delay offloading until all net_devices are fully registered

Netfilter flowtable can theoretically try to offload flower rules as soon
as a net_device is registered while all the other ones are not
registered or initialized, triggering a possible NULL pointer dereferencing
of qdma pointer in airoha_ppe_set_cpu_port routine. Moreover, if
register_netdev() fails for a particular net_device, there is a small
race if Netfilter tries to offload flowtable rules before all the
net_devices are properly unregistered in airoha_probe() error patch,
triggering a NULL pointer dereferencing in airoha_ppe_set_cpu_port
routine. In order to avoid any possible race, delay offloading until
all net_devices are registered in the networking subsystem.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260329-airoha-regiser-race-fix-v2-1-f4ebb139277b@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/airoha/airoha_eth.c
drivers/net/ethernet/airoha/airoha_eth.h
drivers/net/ethernet/airoha/airoha_ppe.c