'struct ovs_zone_limit' has more members than initialized in
ovs_ct_limit_get_default_limit(). The rest of the memory is a random
kernel stack content that ends up being sent to userspace.
Fix that by using designated initializer that will clear all
non-specified fields.
Fixes: 11efd5cb04a1 ("openvswitch: Support conntrack zone limit")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
net/openvswitch/conntrack.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
CC: ovs-dev
On 4/4/21 7:50 PM, Ilya Maximets wrote:
quoted hunk
'struct ovs_zone_limit' has more members than initialized in
ovs_ct_limit_get_default_limit(). The rest of the memory is a random
kernel stack content that ends up being sent to userspace.
Fix that by using designated initializer that will clear all
non-specified fields.
Fixes: 11efd5cb04a1 ("openvswitch: Support conntrack zone limit")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
net/openvswitch/conntrack.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
On Mon, Apr 5, 2021 at 2:01 AM Ilya Maximets [off-list ref] wrote:
CC: ovs-dev
On 4/4/21 7:50 PM, Ilya Maximets wrote:
quoted
'struct ovs_zone_limit' has more members than initialized in
ovs_ct_limit_get_default_limit(). The rest of the memory is a random
kernel stack content that ends up being sent to userspace.
Fix that by using designated initializer that will clear all
non-specified fields.
Fixes: 11efd5cb04a1 ("openvswitch: Support conntrack zone limit")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
net/openvswitch/conntrack.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
@@ -2032,10 +2032,10 @@ static int ovs_ct_limit_del_zone_limit(struct nlattr *nla_zone_limit,staticintovs_ct_limit_get_default_limit(structovs_ct_limit_info*info,structsk_buff*reply){-structovs_zone_limitzone_limit;--zone_limit.zone_id=OVS_ZONE_LIMIT_DEFAULT_ZONE;-zone_limit.limit=info->default_limit;+structovs_zone_limitzone_limit={+.zone_id=OVS_ZONE_LIMIT_DEFAULT_ZONE,+.limit=info->default_limit,+};
I review the code, userspace don't use the count of ovs_zone_lime
struct, but this patch looks to to me.
Thanks Ilya.
Acked-by: Tonghao Zhang <redacted>
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Sun, 4 Apr 2021 19:50:31 +0200 you wrote:
'struct ovs_zone_limit' has more members than initialized in
ovs_ct_limit_get_default_limit(). The rest of the memory is a random
kernel stack content that ends up being sent to userspace.
Fix that by using designated initializer that will clear all
non-specified fields.
[...]