lkml.org 
[lkml]   [2020]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [ovs-dev] [PATCH 1/1] openvswitch: fix infoleak in conntrack
On Tue, Jun 16, 2020 at 10:13 AM Xidong Wang <wangxidong_97@163.com> wrote:
>
> From: xidongwang <wangxidong_97@163.com>
>
> The stack object “zone_limit” has 3 members. In function
> ovs_ct_limit_get_default_limit(), the member "count" is
> not initialized and sent out via “nla_put_nohdr”.
>
> Signed-off-by: xidongwang <wangxidong_97@163.com>
> ---
> net/openvswitch/conntrack.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
> index 4340f25..1b7820a 100644
> --- a/net/openvswitch/conntrack.c
> +++ b/net/openvswitch/conntrack.c
> @@ -2020,6 +2020,7 @@ static int ovs_ct_limit_get_default_limit(struct ovs_ct_limit_info *info,
> {
> struct ovs_zone_limit zone_limit;
> int err;
> + memset(&zone_limit, 0, sizeof(zone_limit));
why not init zone.count == 0, instead of memset, because zone_id/limit
will be inited later.
memset uses more cpu cycles.
> zone_limit.zone_id = OVS_ZONE_LIMIT_DEFAULT_ZONE;
> zone_limit.limit = info->default_limit;
> --
> 2.7.4
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev



--
Best regards, Tonghao

\
 
 \ /
  Last update: 2020-06-16 09:46    [W:0.056 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site