xfrm: Fix xfrm_input() to verify state is valid when (encap_type < 0)
authorAviv Heller <avivh@mellanox.com>
Tue, 28 Nov 2017 17:55:40 +0000 (19:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:08:01 +0000 (11:08 +0100)
commitc232fd3d703499b352d293f6dbc76cda8c7783ed
tree0c1fba48ca2b476f64ee6fe481d984bbfaaa1cf1
parent05fc2b8ba00a94587f9c3f9bed70e71266ceb08d
xfrm: Fix xfrm_input() to verify state is valid when (encap_type < 0)

[ Upstream commit 4ce3dbe397d7b6b15f272ae757c78c35e9e4b61d ]

Code path when (encap_type < 0) does not verify the state is valid
before progressing.

This will result in a crash if, for instance, x->km.state ==
XFRM_STATE_ACQ.

Fixes: 7785bba299a8 ("esp: Add a software GRO codepath")
Signed-off-by: Aviv Heller <avivh@mellanox.com>
Signed-off-by: Yevgeny Kliteynik <kliteyn@mellanox.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/xfrm/xfrm_input.c