mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
xfrm: Fix error return code in xfrm_output_one()
[ Upstream commit533555e5cb] 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:9e14379378("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>
This commit is contained in:
parent
7519ffa911
commit
34a2f36c01
|
|
@ -102,6 +102,7 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
|
|||
skb_dst_force(skb);
|
||||
if (!skb_dst(skb)) {
|
||||
XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR);
|
||||
err = -EHOSTUNREACH;
|
||||
goto error_nolock;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user