* [PATCH ipsec] xfrm: properly handle invalid states as an error
@ 2013-05-22 11:40 Timo Teräs
2013-05-23 8:20 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Timo Teräs @ 2013-05-22 11:40 UTC (permalink / raw)
To: netdev; +Cc: Timo Teräs, Li RongQing, Steffen Klassert
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>
---
Should go also to 3.9-stable.
net/xfrm/xfrm_output.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index bcfda89..0cf003d 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)
if (unlikely(x->km.state != XFRM_STATE_VALID)) {
XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTSTATEINVALID);
+ err = -EINVAL;
goto error;
}
--
1.8.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH ipsec] xfrm: properly handle invalid states as an error
2013-05-22 11:40 [PATCH ipsec] xfrm: properly handle invalid states as an error Timo Teräs
@ 2013-05-23 8:20 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-05-23 8:20 UTC (permalink / raw)
To: timo.teras; +Cc: netdev, roy.qing.li, steffen.klassert
From: Timo Teräs <timo.teras@iki.fi>
Date: Wed, 22 May 2013 14:40:47 +0300
> 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>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-23 8:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-22 11:40 [PATCH ipsec] xfrm: properly handle invalid states as an error Timo Teräs
2013-05-23 8:20 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).