浏览代码

[IPV6] ROUTE: Fix dst reference counting in ip6_pol_route_lookup().

In ip6_pol_route_lookup(), when we finish backtracking at the
top-level root entry, we need to hold it.

Bug noticed by Mitsuru Chinen <CHINEN@jp.ibm.com>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
YOSHIFUJI Hideaki 18 年之前
父节点
当前提交
33cc489668
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/ipv6/route.c

+ 1 - 1
net/ipv6/route.c

@@ -510,8 +510,8 @@ restart:
 	rt = fn->leaf;
 	rt = fn->leaf;
 	rt = rt6_device_match(rt, fl->oif, flags);
 	rt = rt6_device_match(rt, fl->oif, flags);
 	BACKTRACK(&fl->fl6_src);
 	BACKTRACK(&fl->fl6_src);
-	dst_hold(&rt->u.dst);
 out:
 out:
+	dst_hold(&rt->u.dst);
 	read_unlock_bh(&table->tb6_lock);
 	read_unlock_bh(&table->tb6_lock);
 
 
 	rt->u.dst.lastuse = jiffies;
 	rt->u.dst.lastuse = jiffies;