From: Wei Wang <redacted>
When a dst is created by addrconf_dst_alloc() for a host route or an
anycast route, dst->dev points to loopback dev while rt6->rt6i_idev
points to a real device.
When the real device goes down, the current cleanup code only checks for
dst->dev and assumes rt6->rt6i_idev->dev is the same. This causes the
refcount leak on the real device in the above situation.
This patch makes sure to always release the refcount taken on
rt6->rt6i_idev during dst_dev_put().
Fixes: 587fea741134 ("ipv6: mark DST_NOGC and remove the operation of
dst_free()")
Reported-by: John Stultz <redacted>
Tested-by: John Stultz <redacted>
Tested-by: Martin KaFai Lau <redacted>
Signed-off-by: Wei Wang <redacted>
Signed-off-by: Martin KaFai Lau <redacted>
---
net/ipv6/route.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
From: David Ahern <hidden> Date: 2017-08-14 19:05:18
On 8/14/17 11:44 AM, Wei Wang wrote:
From: Wei Wang <redacted>
When a dst is created by addrconf_dst_alloc() for a host route or an
anycast route, dst->dev points to loopback dev while rt6->rt6i_idev
points to a real device.
When the real device goes down, the current cleanup code only checks for
dst->dev and assumes rt6->rt6i_idev->dev is the same. This causes the
refcount leak on the real device in the above situation.
This patch makes sure to always release the refcount taken on
rt6->rt6i_idev during dst_dev_put().
Fixes: 587fea741134 ("ipv6: mark DST_NOGC and remove the operation of
dst_free()")
Reported-by: John Stultz <redacted>
Tested-by: John Stultz <redacted>
Tested-by: Martin KaFai Lau <redacted>
Signed-off-by: Wei Wang <redacted>
Signed-off-by: Martin KaFai Lau <redacted>
---
net/ipv6/route.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
From: David Miller <davem@davemloft.net> Date: 2017-08-15 05:19:46
From: Wei Wang <redacted>
Date: Mon, 14 Aug 2017 10:44:59 -0700
From: Wei Wang <redacted>
When a dst is created by addrconf_dst_alloc() for a host route or an
anycast route, dst->dev points to loopback dev while rt6->rt6i_idev
points to a real device.
When the real device goes down, the current cleanup code only checks for
dst->dev and assumes rt6->rt6i_idev->dev is the same. This causes the
refcount leak on the real device in the above situation.
This patch makes sure to always release the refcount taken on
rt6->rt6i_idev during dst_dev_put().
Fixes: 587fea741134 ("ipv6: mark DST_NOGC and remove the operation of
dst_free()")
Reported-by: John Stultz <redacted>
Tested-by: John Stultz <redacted>
Tested-by: Martin KaFai Lau <redacted>
Signed-off-by: Wei Wang <redacted>
Signed-off-by: Martin KaFai Lau <redacted>