提交 e4077e01 编写于 作者: T Timo Teräs 提交者: David S. Miller

xfrm: Fix crashes in xfrm_lookup()

From: Timo Teräs <timo.teras@iki.fi>

Happens because CONFIG_XFRM_SUB_POLICY is not enabled, and one of
the helper functions I used did unexpected things in that case.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0a5bff74
...@@ -735,19 +735,12 @@ static inline void xfrm_pol_put(struct xfrm_policy *policy) ...@@ -735,19 +735,12 @@ static inline void xfrm_pol_put(struct xfrm_policy *policy)
xfrm_policy_destroy(policy); xfrm_policy_destroy(policy);
} }
#ifdef CONFIG_XFRM_SUB_POLICY
static inline void xfrm_pols_put(struct xfrm_policy **pols, int npols) static inline void xfrm_pols_put(struct xfrm_policy **pols, int npols)
{ {
int i; int i;
for (i = npols - 1; i >= 0; --i) for (i = npols - 1; i >= 0; --i)
xfrm_pol_put(pols[i]); xfrm_pol_put(pols[i]);
} }
#else
static inline void xfrm_pols_put(struct xfrm_policy **pols, int npols)
{
xfrm_pol_put(pols[0]);
}
#endif
extern void __xfrm_state_destroy(struct xfrm_state *); extern void __xfrm_state_destroy(struct xfrm_state *);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册