]> git.baikalelectronics.ru Git - kernel.git/commit
net/ipv6: fix metrics leak
authorSabrina Dubroca <sd@queasysnail.net>
Mon, 30 Jul 2018 14:23:10 +0000 (16:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Jul 2018 16:45:57 +0000 (09:45 -0700)
commit5108d0650421b861a9faa23436db2b2020c09adb
tree0afb2a9351d3d591df033c400255db700d581200
parentedbdc2b045259ee2e4e25a72892f0f558fadfb4c
net/ipv6: fix metrics leak

Since commit b61a880ad6ab ("net/ipv6: move metrics from dst to
rt6_info"), ipv6 metrics are shared and refcounted. rt6_set_from()
assigns the rt->from pointer and increases the refcount on from's
metrics. This reference is never released.

Introduce the fib6_metrics_release() helper and use it to release the
metrics.

Fixes: b61a880ad6ab ("net/ipv6: move metrics from dst to rt6_info")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_fib.c