openvswitch: fix potential out of bound access in parse_ct
authorLiping Zhang <zlpnobody@gmail.com>
Sun, 23 Jul 2017 09:52:23 +0000 (17:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2017 15:49:32 +0000 (08:49 -0700)
commitd53ff3816d94c841f7a7f1bf68505a2abb06757a
tree2cf8f5e901353cecca154261df119d41a522e7ad
parent59e76ed17981aa9ee8da4496d13edf42ec29958c
openvswitch: fix potential out of bound access in parse_ct

[ Upstream commit 69ec932e364b1ba9c3a2085fe96b76c8a3f71e7c ]

Before the 'type' is validated, we shouldn't use it to fetch the
ovs_ct_attr_lens's minlen and maxlen, else, out of bound access
may happen.

Fixes: 7f8a436eaa2c ("openvswitch: Add conntrack action")
Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/openvswitch/conntrack.c