提交 67b40d59 编写于 作者: I Ilya Maximets 提交者: Zheng Zengkai

openvswitch: fix send of uninitialized stack memory in ct limit reply

stable inclusion
from stable-5.10.30
commit cc5418973cc9943c276a5ffef645a20f0aadf596
bugzilla: 51791

--------------------------------

[ Upstream commit 4d51419d ]

'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: 11efd5cb ("openvswitch: Support conntrack zone limit")
Signed-off-by: NIlya Maximets <i.maximets@ovn.org>
Acked-by: NTonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: N  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 cd0044ed
......@@ -2024,10 +2024,10 @@ static int ovs_ct_limit_del_zone_limit(struct nlattr *nla_zone_limit,
static int ovs_ct_limit_get_default_limit(struct ovs_ct_limit_info *info,
struct sk_buff *reply)
{
struct ovs_zone_limit zone_limit;
zone_limit.zone_id = OVS_ZONE_LIMIT_DEFAULT_ZONE;
zone_limit.limit = info->default_limit;
struct ovs_zone_limit zone_limit = {
.zone_id = OVS_ZONE_LIMIT_DEFAULT_ZONE,
.limit = info->default_limit,
};
return nla_put_nohdr(reply, sizeof(zone_limit), &zone_limit);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册