]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipsec: Fix aborted xfrm policy dump crash
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 19 Oct 2017 12:51:10 +0000 (20:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Nov 2017 08:54:49 +0000 (09:54 +0100)
commit20d17a2d1347b3754acfc395c7c57a068fc84d40
tree0fe66a78dc4987b385ad97c31fc1de904ca113c5
parentf2aa694b7459f20d37199651bc2a4495a5559502
ipsec: Fix aborted xfrm policy dump crash

commit 1137b5e2529a8f5ca8ee709288ecba3e68044df2 upstream.

An independent security researcher, Mohamed Ghannam, has reported
this vulnerability to Beyond Security's SecuriTeam Secure Disclosure
program.

The xfrm_dump_policy_done function expects xfrm_dump_policy to
have been called at least once or it will crash.  This can be
triggered if a dump fails because the target socket's receive
buffer is full.

This patch fixes it by using the cb->start mechanism to ensure that
the initialisation is always done regardless of the buffer situation.

Fixes: 12a169e7d8f4 ("ipsec: Put dumpers on the dump list")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/xfrm/xfrm_user.c