Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2564315lkm; Mon, 20 Sep 2021 18:50:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztAWgt+S4Yfj6JIcHCNsAJtzvrdyD4TU0HVNa6sc8Qkzy6g5aN3gIL4hyTe+dhf5CUWGdU X-Received: by 2002:a05:6e02:1887:: with SMTP id o7mr9298740ilu.12.1632188923721; Mon, 20 Sep 2021 18:48:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188923; cv=none; d=google.com; s=arc-20160816; b=iJk4yGi8X0zmq7bSo8NnIvoyBliE3NXb/9uiDOzSChr/zAv5MJpFzf7ORhNcyL3Rd9 zND6qsi7zMjD/RmDahg0i4NWWJQ+vKmojggbgBXagbDpkENsQ7GPcfL5ihInZWle8yxx Mm6xMnKAp/GJtnw2+E1m6kUY9yp2kPkDTV9SUqCBt256LxQRTxG/Q0wzWk3gej8jZFDk Sh1/qhT8L1A4Y4MGiro+mpNh0bdaZ7xFuMyg2e8Se8mk99FafPaYc68pUn5i2xtRywb0 /Q83FIQsWhpEWDSup1c9tuMvZB5wwEvwV8VObGXgGulI5hTfbzOJQ+z/XmQ1QTIhnCY+ LucA== 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=uWhPqK8cnBaVlsy/sD7Zl8e/K5I6V7jEdNZKUAAvQ5w=; b=bkVMJ+MRDgrEd1ZygBuv9OW8t+RWyASskTLFgej2izPOuUDovzG8FQMgezG5+6X/aE kIgf9Uvtf7PbYCiV3RG/SnIW8nkUCSlRxiyteidGl9qpGVWbHDSDX6LuxSZ03Q/tb7uh AKslter0OEOnXMwFwNvJuE4EZiN2L7ap2UKApejZ5lz/V0Z4rRojVoxGxRdTE2VZjUbn X5y7oFQp8+7gNIfNlmAyira43vFly9ovMId29u6DeuNoaKbSfRrN6JABxb9uOvbqlHDJ RrFAevKukoT+B4mCN/RPF7ZfqMVi2pdQjYBnNIcBcWtc3+F+kj0nBdTjbZlSmdpWolOj OIfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1L2fFPaV; 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 a14si3239831ilc.22.2021.09.20.18.48.32; Mon, 20 Sep 2021 18:48:43 -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=1L2fFPaV; 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 S1348116AbhITRf4 (ORCPT + 99 others); Mon, 20 Sep 2021 13:35:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:35448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347956AbhITReH (ORCPT ); Mon, 20 Sep 2021 13:34:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EC35961B1B; Mon, 20 Sep 2021 17:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157535; bh=33DcH61tLZwlM98lnoBTHq6zyViBcn+gEVHifLvuihA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1L2fFPaVA7nKK2QUXPLxXV3pFnyxDA89oISMZorFEAdXETR43e0bFhFPhtCKkcZJ8 EFw963fM/Rl+UN/65eayewBLIadDuyqffftqro3dyj7vv+HOfIxnWJO0MLCilsj8Tr p/UKpLLqXVQRQspZeEGOQwirOvxmTUuyr9phUZn8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Prabhakar Kushwaha , Ariel Elior , Shai Malin , Kees Cook , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 006/293] qede: Fix memset corruption Date: Mon, 20 Sep 2021 18:39:28 +0200 Message-Id: <20210920163933.475126262@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@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: Shai Malin [ Upstream commit e543468869e2532f5d7926e8f417782b48eca3dc ] Thanks to Kees Cook who detected the problem of memset that starting from not the first member, but sized for the whole struct. The better change will be to remove the redundant memset and to clear only the msix_cnt member. Signed-off-by: Prabhakar Kushwaha Signed-off-by: Ariel Elior Signed-off-by: Shai Malin Reported-by: Kees Cook Reviewed-by: Kees Cook Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qede/qede_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c index 1aabb2e7a38b..756c5943f5e0 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_main.c +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c @@ -1676,6 +1676,7 @@ static void qede_sync_free_irqs(struct qede_dev *edev) } edev->int_info.used_cnt = 0; + edev->int_info.msix_cnt = 0; } static int qede_req_msix_irqs(struct qede_dev *edev) @@ -2193,7 +2194,6 @@ static int qede_load(struct qede_dev *edev, enum qede_load_mode mode, goto out; err4: qede_sync_free_irqs(edev); - memset(&edev->int_info.msix_cnt, 0, sizeof(struct qed_int_info)); err3: qede_napi_disable_remove(edev); err2: -- 2.30.2