From patchwork Wed Oct 26 13:51:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 13020679 X-Patchwork-Delegate: kuba@kernel.org 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 1E004FA3741 for ; Wed, 26 Oct 2022 13:54:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233997AbiJZNyf (ORCPT ); Wed, 26 Oct 2022 09:54:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233972AbiJZNxU (ORCPT ); Wed, 26 Oct 2022 09:53:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 631CC109D40 for ; Wed, 26 Oct 2022 06:52:53 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 0006861EB1 for ; Wed, 26 Oct 2022 13:52:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 947B7C433C1; Wed, 26 Oct 2022 13:52:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666792372; bh=bwX3dE+l3xsZYEto6hXAFz362lOOdVcg/Uvu97+QNKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hSwUV9lW9haC5m63tSojNYZX8pR3C9aIclC1GfOQMB/GCCUuBhPVZcdB72Y8xWEZh +TCflFMZN+yB0N+4YRLmYSuV0G+GyLbwJUm5X1nOsQP6RdqZyq7XWXzCHW0G7VOzOp LRG4WCZ5ajkh5AeNe0r1lTaRakrtiVu221na10jYnsP+CwRph+8UHSp9iMATXAQeTL U2J6HTgxmJxF0i4/9LOIocXm6Fj6jxeOfKBJn3FI34u7/ICqNOM2W9Ybu6rvWDYP3L CRju/CFg2P4kucNrI8tEogFamztpI4aP3j4PAJbZe3aNWp7ZtRd2JyVdv0fV+/dgeU tXxqGoBz+bpFQ== 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: [V4 net 12/15] net/mlx5e: Fix macsec coverity issue at rx sa update Date: Wed, 26 Oct 2022 14:51:50 +0100 Message-Id: <20221026135153.154807-13-saeed@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221026135153.154807-1-saeed@kernel.org> References: <20221026135153.154807-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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)