From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD0EFFA3740 for ; Mon, 24 Oct 2022 12:23:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233534AbiJXMXl (ORCPT ); Mon, 24 Oct 2022 08:23:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233302AbiJXMWr (ORCPT ); Mon, 24 Oct 2022 08:22:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13F141B1DC for ; Mon, 24 Oct 2022 04:58:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3A002B811C0 for ; Mon, 24 Oct 2022 11:55:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 777A0C433B5; Mon, 24 Oct 2022 11:55:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666612509; bh=bwX3dE+l3xsZYEto6hXAFz362lOOdVcg/Uvu97+QNKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n9z59HDYnHXldxiJj/IcDAg8NO6KBqvMLlh24U37wwF5t1yNdAn8pVqO4a0amn5yC rPNX8S/FhfMpYE52ylynPM/V2NbYORe3WsMWsLM25UTaoVPfjKMlMvfNL5zVd6NYz8 A+OrPnasCc++yIZ40mlqi8Xh5CC9EsPdfhDUcys2Nn+0fGokPLVi2jFlJ+c26tHd6A WhFja1LS0LnHQSYxKoYhdFAbXHppIp7fHQkNmK7jXB1ghp2VW7JGjgWRaFLIX4LxuZ rb+OY62eZsxUV9VNfrAia/nFlYHAkYyLdMVWDkmdWy1Dseygu2kLF0m0DBhpW66xSc lmQmupU52IhFA== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Raed Salem , Lior Nahmanson Subject: [V3 net 13/16] net/mlx5e: Fix macsec coverity issue at rx sa update Date: Mon, 24 Oct 2022 12:53:54 +0100 Message-Id: <20221024115357.37278-14-saeed@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221024115357.37278-1-saeed@kernel.org> References: <20221024115357.37278-1-saeed@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Raed Salem The cited commit at update rx sa operation passes object attributes to MACsec object create function without initializing/setting all attributes fields leaving some of them with garbage values, therefore violating the implicit assumption at create object function, which assumes that all input object attributes fields are set. Fix by initializing the object attributes struct to zero, thus leaving unset fields with the legal zero value. Fixes: aae3454e4d4c ("net/mlx5e: Add MACsec offload Rx command support") Signed-off-by: Raed Salem Reviewed-by: Lior Nahmanson Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c index 4331235b21ee..250c878ba2c9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c @@ -432,7 +432,7 @@ static int mlx5e_macsec_update_rx_sa(struct mlx5e_macsec *macsec, bool active) { struct mlx5_core_dev *mdev = macsec->mdev; - struct mlx5_macsec_obj_attrs attrs; + struct mlx5_macsec_obj_attrs attrs = {}; int err = 0; if (rx_sa->active != active) -- 2.37.3