net: vrf: check register_netdevice_notifier() error in vrf_init_module()
Subsystems (3)
PATCH 1/1 net: vrf: check register_netdevice_notifier() error in vrf_init_module()
vrf_init_module() ignores register_netdevice_notifier() errors and continues module initialization, which can leave VRF loaded without its netdev notifier registered.
Check the error and fail module initialization early.
--- drivers/net/vrf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/vrf.c +3 -1
@@ -1932,7 +1932,9 @@ static int __init vrf_init_module(void) {int rc; -register_netdevice_notifier (&vrf_notifier_block); + rc =register_netdevice_notifier (&vrf_notifier_block); +if (rc <0 ) +return rc; rc =register_pernet_subsys (&vrf_net_ops);if (rc <0 )
Signature · 1 line
2.25.1
Quoted 6 lines · Minhong He
vrf_init_module()ignoresregister_netdevice_notifier()errors and continues module initialization, which can leave VRF loaded without its netdev notifier registered.Check the error and fail module initialization early.
Quoted 10 lines
Signed-off-by Minhong He <[email protected]>--- drivers/net/vrf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/net/vrf.c +0
-0
drivers/net/vrf.c static int __init vrf_init_module(void) · line 1940
Quoted 10 lines
drivers/net/vrf.c +3
-1@@ -1932,7 +1932,9 @@ static int __init vrf_init_module(void) {int rc; -register_netdevice_notifier (&vrf_notifier_block); + rc =register_netdevice_notifier (&vrf_notifier_block); +if (rc <0 ) +return rc; rc =register_pernet_subsys (&vrf_net_ops);if (rc <0 )
Jakub Kicinski
maintainerQuoted 1 line · On Mon, 3 Aug 2026 10:59:47 -0600 David Ahern wrote:
Fixes 193125dbd8eb ("net: Introduce VRF device driver")
Thanks for the tag and the review!
In this case I'm going to skip and take this via net-next 'cause register_netdevice_notifier() is guaranteed not to fail today.
David Ahern
maintainerQuoted 3 lines · Jakub Kicinski
In this case I'm going to skip and take this via net-next 'cause
register_netdevice_notifier()is guaranteed not to fail today.
considered that response, so it works for me.
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Mon, 3 Aug 2026 17:00:02 +0800 you wrote:
vrf_init_module()ignoresregister_netdevice_notifier()errors and continues module initialization, which can leave VRF loaded without its netdev notifier registered.Check the error and fail module initialization early.
Signed-off-by Minhong He <[email protected]>[...]
Here is the summary with links:
- [net] net: vrf: check register_netdevice_notifier() error in vrf_init_module()
https://git.kernel.org/netdev/net-next/c/ac072a89cba2
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html