]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Aug 2020 22:09:44 +0000 (15:09 -0700)
commite917a1bf8cf1c1544282e8189301490682863f24
tree463c4df1b2822faca26695301e0b30f2fa095c55
parente4f617a63f8d4afe0eb3c077d4856c28e7b3880d
openvswitch: Prevent kernel-infoleak in ovs_ct_put_key()

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: a640cd0156a5 ("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>
net/openvswitch/conntrack.c