提交 ec650b23 编写于 作者: S Steffen Klassert

xfrm: Fix xfrm_dst_cache memleak

We have a memleak whenever a flow matches a policy without
a matching SA. In this case we generate a dummy bundle and
take an additional refcount on the dst_entry. This was needed
as long as we had the flowcache. The flowcache removal patches
deleted all related refcounts but forgot the one for the
dummy bundle case. Fix the memleak by removing this refcount.

Fixes: 3ca28286 ("xfrm_policy: bypass flow_cache_lookup")
Reported-by: NMaxime Bizon <mbizon@freebox.fr>
Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
上级 864f5af3
......@@ -2076,7 +2076,6 @@ xfrm_bundle_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir,
xdst->num_xfrms = num_xfrms;
memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols);
dst_hold(&xdst->u.dst);
return xdst;
inc_error:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册