ipv6: do not check fib6_has_expires() in fib6_info_release()
Subsystems (3)
PATCH 1/1 ipv6: do not check fib6_has_expires() in fib6_info_release()
My prior patch went a bit too far, because apparently fib6_has_expires() could be true while f6i->gc_link is not hashed yet.
fib6_set_expires_locked() can indeed set RTF_EXPIRES while f6i->fib6_table is NULL.
Original syzbot reports were about corruptions caused by dangling f6i->gc_link.
--- include/net/ip6_fib.h | 1 - 1 file changed, 1 deletion(-)
include/net/ip6_fib.h +0 -1
@@ -329,7 +329,6 @@ static inline bool fib6_info_hold_safe(struct fib6_info *f6i)static inline void fib6_info_release (struct fib6_info *f6i) {if (f6i &&refcount_dec_and_test (&f6i->fib6_ref)) { -DEBUG_NET_WARN_ON_ONCE (fib6_has_expires (f6i));DEBUG_NET_WARN_ON_ONCE (!hlist_unhashed (&f6i->gc_link));call_rcu (&f6i->rcu, fib6_info_destroy_rcu); }
Signature · 1 line
2.43.0.472.g3155946c3a-goog
Quoted 2 lines · Eric Dumazet
My prior patch went a bit too far, because apparently
fib6_has_expires()could be true whilef6i->gc_linkis not hashed yet.
yes, and I got distracted by that stack trace and avoiding errors in the create function. The diff I sent does not solve any corruption with list since the newly allocated f6i is not linked (and gc-link is initialized).
Kui-Feng: no need to send that patch again since it is not really changing anything. Let's see if the other warn on triggers.
Quoted 7 lines
fib6_set_expires_locked()can indeed setRTF_EXPIRESwhilef6i->fib6_tableis NULL.Original syzbot reports were about corruptions caused by dangling
f6i->gc_link.
Quoted 9 lines
Fixes 5a08d0065a91 ("ipv6: add debug checks in fib6_info_release()")Reported-by [email protected]Signed-off-by Eric Dumazet <[email protected]>Cc David Ahern <[email protected]>Cc Kui-Feng Lee <[email protected]>--- include/net/ip6_fib.h | 1 - 1 file changed, 1 deletion(-)
Quoted 10 lines · David Ahern
Quoted 2 lines · Eric Dumazet
My prior patch went a bit too far, because apparently
fib6_has_expires()could be true whilef6i->gc_linkis not hashed yet.yes, and I got distracted by that stack trace and avoiding errors in the create function. The diff I sent does not solve any corruption with list since the newly allocated f6i is not linked (and gc-link is initialized).
Kui-Feng: no need to send that patch again since it is not really changing anything. Let's see if the other warn on triggers.
Got it!
Quoted 22 lines
Quoted 8 lines
fib6_set_expires_locked()can indeed setRTF_EXPIRESwhilef6i->fib6_tableis NULL.Original syzbot reports were about corruptions caused by dangling
f6i->gc_link.Quoted 9 lines
Fixes 5a08d0065a91 ("ipv6: add debug checks in fib6_info_release()")Reported-by [email protected]Signed-off-by Eric Dumazet <[email protected]>Cc David Ahern <[email protected]>Cc Kui-Feng Lee <[email protected]>--- include/net/ip6_fib.h | 1 - 1 file changed, 1 deletion(-)Reviewed-by David Ahern <[email protected]>
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 10 lines · On Thu, 7 Dec 2023 20:13:22 +0000 you wrote:
My prior patch went a bit too far, because apparently
fib6_has_expires()could be true whilef6i->gc_linkis not hashed yet.
fib6_set_expires_locked()can indeed setRTF_EXPIRESwhilef6i->fib6_tableis NULL.Original syzbot reports were about corruptions caused by dangling
f6i->gc_link.[...]
Here is the summary with links:
- [net-next] ipv6: do not check fib6_has_expires() in fib6_info_release()
https://git.kernel.org/netdev/net-next/c/a3c205d0560f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html