Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2064319pxb; Mon, 12 Apr 2021 13:22:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2wfDyU7U5JZ106+JYhlSxA+cllWAwhcgMb7WAiCF+RSert6cjS1NOFXtwW8kCNLSG5U/s X-Received: by 2002:a17:906:7f01:: with SMTP id d1mr29436256ejr.136.1618258975781; Mon, 12 Apr 2021 13:22:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618258975; cv=none; d=google.com; s=arc-20160816; b=BUEQmXw0JNwjvj2jHL+/jZS3wuUSkIpKI6p5Uy6EkohmXGx3tJbIPX8+Oo/oA8QXbW fD1QT4S7EME3FfUXnb7a5SWx8GiKS8xA1Jg60LxrXZgpIDvGjjRUNmYK/iuAWr/mcRlq a2cYkdkcIEYf2i/LtgCT4EoTaOYFkPWbfkcVXrftgpoYG1EPCGD1ze3NYxAhVAeCUNHm K1LxHjCHavJGp5yKdquA+/EbMoHf6ZBAc49W/Ur3K/e64okgJWShhNbqtbtBfirqWhDj 3k5ISHwafMvXFVIShQle/C7ltzB79wyMHctGOyuHAKdxH1LKcTJCKDjnbEGaNJMLJx2a DL1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gVcCz+J7ycpJEenVFuZ0LPB+T0UjLvBrTjg4yGcmvqA=; b=LcmOtM73F+yX9yhFAft6RYrnIUT10GcofZefXAwZEsG2gtjr6SjevNXN7+9/xOns+s e2ymEuvySp4Fmc5moAQAE2RQxWmZur4PZyNoOWfk0NkNREnmoDTTZ0L/7fMi0NIJviCL xqVjpPw7yTzvJmr6TT8178U0sAQqrr+oqhK4mk/ZPdyU0g+m8YOKR3eQKjd4ahT5eDGZ eDo4aDbLwunA/WpfrzGORP5DRR1LKPHqyGS7V5974tyUDL0KCJpHj1xF5L1Qpe2zJzNB a5tJcdhRsZDEze51HMmEmkvvDve8VT5ChhrbNLXztvTOGXDzhWsmeHmI+gq/FXuaw7Qe uxuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bK2qLjO2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp12si8008639ejc.526.2021.04.12.13.22.31; Mon, 12 Apr 2021 13:22:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bK2qLjO2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238379AbhDLI4W (ORCPT + 99 others); Mon, 12 Apr 2021 04:56:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:39498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238485AbhDLIt5 (ORCPT ); Mon, 12 Apr 2021 04:49:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 79EAA6127A; Mon, 12 Apr 2021 08:49:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618217355; bh=ydBzpuGoeZ2kJN+fhVJl1Az0edvI9ghNf3U5TAmUP8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bK2qLjO2myQmlHAnXhsWHZuA6wCPELvcZaaV5TjxGf2O74ULESzECdRewbXienB2v WzLHJlNC0apIeKf9K3GAPfyjCQJ4rae24iZep/n037OeFgomesEA+e27aMdp3N8UGH EDahjUgMgych73eKKvJbbeVnWPecwIbk34T4hytk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilya Maximets , Tonghao Zhang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 088/111] openvswitch: fix send of uninitialized stack memory in ct limit reply Date: Mon, 12 Apr 2021 10:41:06 +0200 Message-Id: <20210412084007.180919758@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210412084004.200986670@linuxfoundation.org> References: <20210412084004.200986670@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilya Maximets [ Upstream commit 4d51419d49930be2701c2633ae271b350397c3ca ] '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 Acked-by: Tonghao Zhang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/openvswitch/conntrack.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c index e905248b11c2..b6f98eba71f1 100644 --- a/net/openvswitch/conntrack.c +++ b/net/openvswitch/conntrack.c @@ -2019,10 +2019,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); } -- 2.30.2