]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.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)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 16 Nov 2017 13:23:31 +0000 (11:23 -0200)
commit84c47275c5723e937c1268e31969a0a74a9d76b4
tree0f786f54182023237a6b278598e1c16c4c54903d
parent879ab4225c7cacba77f4310616513c46a82b1dd1
ipsec: Fix aborted xfrm policy dump crash

BugLink: http://bugs.launchpad.net/bugs/1731961
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>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
net/xfrm/xfrm_user.c