diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-05-21 21:40:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-23 04:20:07 -0400 |
commit | 497574c72c9922cf20c12aed15313c389f722fa0 (patch) | |
tree | 1ded621483211872633af219157427bc0cf26e43 /net | |
parent | e4166625edfd2d808ddda00c7e7e901f4f3b8cc0 (diff) |
xfrm: properly handle invalid states as an error
The error exit path needs err explicitly set. Otherwise it
returns success and the only caller, xfrm_output_resume(),
would oops in skb_dst(skb)->ops derefence as skb_dst(skb) is
NULL.
Bug introduced in commit bb65a9cb (xfrm: removes a superfluous
check and add a statistic).
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Cc: Li RongQing <roy.qing.li@gmail.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/xfrm/xfrm_output.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index bcfda8921b5b..0cf003dfa8fc 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c | |||
@@ -64,6 +64,7 @@ static int xfrm_output_one(struct sk_buff *skb, int err) | |||
64 | 64 | ||
65 | if (unlikely(x->km.state != XFRM_STATE_VALID)) { | 65 | if (unlikely(x->km.state != XFRM_STATE_VALID)) { |
66 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTSTATEINVALID); | 66 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTSTATEINVALID); |
67 | err = -EINVAL; | ||
67 | goto error; | 68 | goto error; |
68 | } | 69 | } |
69 | 70 | ||