Vegard Nossum 1ba5bf993c xfrm: fix crash in XFRM_MSG_GETSA netlink handler
If we hit any of the error conditions inside xfrm_dump_sa(), then
xfrm_state_walk_init() never gets called. However, we still call
xfrm_state_walk_done() from xfrm_dump_sa_done(), which will crash
because the state walk was never initialized properly.

We can fix this by setting cb->args[0] only after we've processed the
first element and checking this before calling xfrm_state_walk_done().

Fixes: d3623099d3 ("ipsec: add support of limited SA dump")
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
2016-07-18 09:37:02 +02:00
..
2016-04-13 10:41:10 +02:00
2016-05-27 15:26:11 -07:00
2016-05-23 13:51:10 -07:00
2016-07-05 14:08:47 -07:00
2016-05-11 19:36:28 -04:00
2016-06-22 16:32:23 -04:00
2016-05-29 22:33:25 -07:00
2016-07-04 16:09:49 -07:00
2016-06-07 15:30:21 -07:00
2016-06-10 23:22:55 -07:00
2016-06-09 23:41:03 -07:00
2016-05-08 23:46:14 -04:00