ipv6/addrconf: ensure addrconf_verify_rtnl() has completed
Subsystems (3)
PATCH 1/1 ipv6/addrconf: ensure addrconf_verify_rtnl() has completed
From: Eric Dumazet <[email protected]>
Before freeing the hash table in addrconf_exit_net(), we need to make sure the work queue has completed, or risk NULL dereference or UAF.
Thus, use cancel_delayed_work_sync() to enforce this. We do not hold RTNL in addrconf_exit_net(), making this safe.
--- net/ipv6/addrconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/addrconf.c +1 -1
@@ -7187,7 +7187,7 @@ static void __net_exit addrconf_exit_net(struct net *net)kfree (net->ipv6.devconf_all); net->ipv6.devconf_all =NULL ; -cancel_delayed_work (&net->ipv6.addr_chk_work); +cancel_delayed_work_sync (&net->ipv6.addr_chk_work);/* * Check hash table, then free it. */
Signature · 1 line
2.35.1.265.g69c8d7142f-goog
Quoted 9 lines · Eric Dumazet
From: Eric Dumazet <[email protected]>
Before freeing the hash table in
addrconf_exit_net(), we need to make sure the work queue has completed, or risk NULL dereference or UAF.Thus, use
cancel_delayed_work_sync()to enforce this. We do not hold RTNL inaddrconf_exit_net(), making this safe.
Quoted 7 lines
Fixes 8805d13ff1b2 ("ipv6/addrconf: use one delayed work per netns")Signed-off-by Eric Dumazet <[email protected]>Reported-by syzbot <[email protected]>--- net/ipv6/addrconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Wed, 16 Feb 2022 10:20:37 -0800 you wrote:
From: Eric Dumazet <[email protected]>
Before freeing the hash table in
addrconf_exit_net(), we need to make sure the work queue has completed, or risk NULL dereference or UAF.Thus, use
cancel_delayed_work_sync()to enforce this. We do not hold RTNL inaddrconf_exit_net(), making this safe.[...]
Here is the summary with links:
- [net-next] ipv6/addrconf: ensure addrconf_verify_rtnl() has completed
https://git.kernel.org/netdev/net-next/c/be6b41c15dc0
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html