netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG ?] ipv6: addrconf: Adds a missing in6_ifa_hold()
@ 2017-10-31  3:53 Eric Dumazet
  2017-10-31  4:49 ` David Ahern
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Dumazet @ 2017-10-31  3:53 UTC (permalink / raw)
  To: David Ahern; +Cc: netdev

David, I was looking at addrconf_permanent_addr() and wondered
if there is not some problem with it.

It seems we need to increment ifp refcount before calling
ipv6_del_addr()

Could you double check if this patch is needed, I am guessing you have a
test suite exercising this code path ?

Thanks.

PS : Presumably CONFIG_REFCOUNT_FULL=y should have warned you of the
problem.

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 4a96ebbf8eda5f59a6ff88e836d666a404d2bf0d..8a1c846d3df949a4638589f187120db22a3525ba 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3335,6 +3335,7 @@ static void addrconf_permanent_addr(struct net_device *dev)
 		if ((ifp->flags & IFA_F_PERMANENT) &&
 		    fixup_permanent_addr(idev, ifp) < 0) {
 			write_unlock_bh(&idev->lock);
+			in6_ifa_hold(ifp);
 			ipv6_del_addr(ifp);
 			write_lock_bh(&idev->lock);
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-01 12:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-31  3:53 [BUG ?] ipv6: addrconf: Adds a missing in6_ifa_hold() Eric Dumazet
2017-10-31  4:49 ` David Ahern
2017-10-31  4:56   ` Eric Dumazet
2017-10-31  5:47   ` [PATCH net] ipv6: addrconf: increment ifp refcount before ipv6_del_addr() Eric Dumazet
2017-10-31 16:09     ` David Ahern
2017-10-31 16:33       ` Eric Dumazet
2017-11-01 12:20     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).