openvswitch: Prevent kernel-infoleak in ovs_ct_put_key()
authorPeilin Ye <yepeilin.cs@gmail.com>
Fri, 31 Jul 2020 04:48:38 +0000 (00:48 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Aug 2020 13:35:41 +0000 (15:35 +0200)
commit0599307728f96b722464d0e35489916ba06acac1
tree7cf5e5fa2b5be245f033473f52f0c385110043d7
parent45e69b071f00d7e7c0bb29c7cda5d091beb99691
openvswitch: Prevent kernel-infoleak in ovs_ct_put_key()

[ Upstream commit 9aba6c5b49254d5bee927d81593ed4429e91d4ae ]

ovs_ct_put_key() is potentially copying uninitialized kernel stack memory
into socket buffers, since the compiler may leave a 3-byte hole at the end
of `struct ovs_key_ct_tuple_ipv4` and `struct ovs_key_ct_tuple_ipv6`. Fix
it by initializing `orig` with memset().

Fixes: 9dd7f8907c37 ("openvswitch: Add original direction conntrack tuple to sw_flow_key.")
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/openvswitch/conntrack.c