Re: [PATCH] ipv6: release idev lock before calling ipv6_ifa_notify()

From: David Miller
Date: Fri Jan 29 2016 - 20:43:42 EST


From: Gregory Herrero <gregory.herrero@xxxxxxxxx>
Date: Thu, 28 Jan 2016 09:34:52 +0100

> @@ -2302,8 +2302,11 @@ static void manage_tempaddrs(struct inet6_dev *idev,
> ift->flags &= ~IFA_F_DEPRECATED;
>
> spin_unlock(&ift->lock);
> - if (!(flags&IFA_F_TENTATIVE))
> + if (!(flags & IFA_F_TENTATIVE)) {
> + read_unlock_bh(&idev->lock);
> ipv6_ifa_notify(0, ift);
> + read_lock_bh(&idev->lock);
> + }
> }
>
> if ((create || list_empty(&idev->tempaddr_list)) &&

You can't do this, the idev->lock has to be held to keep the list we
are iterating over from changing.