xfrm: Fix error return code in xfrm_output_one()
authorWei Yongjun <weiyongjun1@huawei.com>
Sat, 27 Oct 2018 06:12:06 +0000 (06:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 09:00:57 +0000 (10:00 +0100)
commitbf2b044bc820cf1d6fa74ff77b09c33886a01568
treec8fd2682ed02058f979132aee62a71ab9af96a55
parent7932e14f9fec2dca602b6e213445eb9bc5c6c4c6
xfrm: Fix error return code in xfrm_output_one()

[ Upstream commit 533555e5cbb6aa2d77598917871ae5b579fe724b ]

xfrm_output_one() does not return a error code when there is
no dst_entry attached to the skb, it is still possible crash
with a NULL pointer dereference in xfrm_output_resume(). Fix
it by return error code -EHOSTUNREACH.

Fixes: 9e1437937807 ("xfrm: Fix NULL pointer dereference when skb_dst_force clears the dst_entry.")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/xfrm/xfrm_output.c