Skip to content

Commit

Permalink
xfrm: properly handle invalid states as an error
Browse files Browse the repository at this point in the history
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 bb65a9c (xfrm: removes a superfluous
check and add a statistic).

Signed-off-by: Timo Teräs <[email protected]>
Cc: Li RongQing <[email protected]>
Cc: Steffen Klassert <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
fabled authored and davem330 committed May 23, 2013
1 parent e416662 commit 497574c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/xfrm/xfrm_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ static int xfrm_output_one(struct sk_buff *skb, int err)

if (unlikely(x->km.state != XFRM_STATE_VALID)) {
XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTSTATEINVALID);
err = -EINVAL;
goto error;
}

Expand Down

0 comments on commit 497574c

Please sign in to comment.