summaryrefslogtreecommitdiff
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorVegard Nossum <vegard.nossum@oracle.com>2016-07-05 10:18:08 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-10 10:25:50 +0200
commit0cbb0084fa2b444b7316a0967a0d93f5ae520216 (patch)
treee543e5ccd5ee61998899ba818556596389d25941 /net/core/sock.c
parent6eea9a76509caa5cf107125d55f72d585e0a4a3a (diff)
xfrm: fix crash in XFRM_MSG_GETSA netlink handler
commit 1ba5bf993c6a3142e18e68ea6452b347f9cb5635 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/core/sock.c')
0 files changed, 0 insertions, 0 deletions