]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfrm: Fix crash when the hold queue is used.
authorSteffen Klassert <steffen.klassert@secunet.com>
Fri, 17 Jul 2020 08:34:27 +0000 (10:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2020 07:58:40 +0000 (09:58 +0200)
commit4c0e6189fbfac19a4baf32fd9731e75598ba7d84
tree095a364c6dd5b282c8f388181489eb27cea64be6
parent589b5e620160cd5007136f863cedc20b24877f99
xfrm: Fix crash when the hold queue is used.

[ Upstream commit 101dde4207f1daa1fda57d714814a03835dccc3f ]

The commits "xfrm: Move dst->path into struct xfrm_dst"
and "net: Create and use new helper xfrm_dst_child()."
changed xfrm bundle handling under the assumption
that xdst->path and dst->child are not a NULL pointer
only if dst->xfrm is not a NULL pointer. That is true
with one exception. If the xfrm hold queue is used
to wait until a SA is installed by the key manager,
we create a dummy bundle without a valid dst->xfrm
pointer. The current xfrm bundle handling crashes
in that case. Fix this by extending the NULL check
of dst->xfrm with a test of the DST_XFRM_QUEUE flag.

Fixes: 0f6c480f23f4 ("xfrm: Move dst->path into struct xfrm_dst")
Fixes: b92cf4aab8e6 ("net: Create and use new helper xfrm_dst_child().")
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/xfrm.h