All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Shai Malin <smalin@marvell.com>,
	Prabhakar Kushwaha <pkushwaha@marvell.com>,
	Ariel Elior <aelior@marvell.com>,
	Kees Cook <keescook@chromium.org>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.10 05/11] qede: Fix memset corruption
Date: Mon, 30 Aug 2021 07:59:56 -0400	[thread overview]
Message-ID: <20210830120002.1017700-5-sashal@kernel.org> (raw)
In-Reply-To: <20210830120002.1017700-1-sashal@kernel.org>

From: Shai Malin <smalin@marvell.com>

[ 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 <pkushwaha@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Shai Malin <smalin@marvell.com>
Reported-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 d9a3c811ac8b..e93f06e4a172 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -1869,6 +1869,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)
@@ -2409,7 +2410,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


  parent reply	other threads:[~2021-08-30 12:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 11:59 [PATCH AUTOSEL 5.10 01/11] gpu: ipu-v3: Fix i.MX IPU-v3 offset calculations for (semi)planar U/V formats Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.10 02/11] reset: reset-zynqmp: Fixed the argument data type Sasha Levin
2021-08-30 11:59   ` Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.10 03/11] qed: Fix the VF msix vectors flow Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.10 04/11] net: macb: Add a NULL check on desc_ptp Sasha Levin
2021-08-30 11:59 ` Sasha Levin [this message]
2021-08-30 11:59 ` [PATCH AUTOSEL 5.10 06/11] perf/x86/intel/pt: Fix mask of num_address_ranges Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.10 07/11] ceph: fix possible null-pointer dereference in ceph_mdsmap_decode() Sasha Levin
2021-08-30 11:59 ` [PATCH AUTOSEL 5.10 08/11] perf/x86/amd/ibs: Work around erratum #1197 Sasha Levin
2021-08-30 12:00 ` [PATCH AUTOSEL 5.10 09/11] perf/x86/amd/power: Assign pmu.module Sasha Levin
2021-08-30 12:00 ` [PATCH AUTOSEL 5.10 10/11] net: fix NULL pointer reference in cipso_v4_doi_free Sasha Levin
2021-08-30 12:00 ` [PATCH AUTOSEL 5.10 11/11] cryptoloop: add a deprecation warning Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210830120002.1017700-5-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=aelior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pkushwaha@marvell.com \
    --cc=smalin@marvell.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.