From: Ciara Loftus <ciara.loftus@intel.com>
To: dev@dpdk.org
Cc: Menachem Fogel <menachem.fogel@intel.com>,
stable@dpdk.org, Dima Ruinskiy <dima.ruinskiy@intel.com>,
Ciara Loftus <ciara.loftus@intel.com>
Subject: [PATCH 07/10] net/e1000/base: fix NVM loop bounds and pointer access
Date: Wed, 20 May 2026 12:52:44 +0000 [thread overview]
Message-ID: <20260520125256.354336-8-ciara.loftus@intel.com> (raw)
In-Reply-To: <20260520125256.354336-1-ciara.loftus@intel.com>
From: Menachem Fogel <menachem.fogel@intel.com>
Improve the NVM checksum routines by ensuring loop bounds are compared
at the correct integer width. Use array indexing instead of explicit
pointer arithmetic.
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Menachem Fogel <menachem.fogel@intel.com>
Signed-off-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
drivers/net/intel/e1000/base/e1000_82575.c | 4 ++--
drivers/net/intel/e1000/base/e1000_manage.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/intel/e1000/base/e1000_82575.c b/drivers/net/intel/e1000/base/e1000_82575.c
index c263f42ca1..8ae2b77d5f 100644
--- a/drivers/net/intel/e1000/base/e1000_82575.c
+++ b/drivers/net/intel/e1000/base/e1000_82575.c
@@ -2395,7 +2395,7 @@ s32 e1000_validate_nvm_checksum_with_offset(struct e1000_hw *hw, u16 offset)
DEBUGFUNC("e1000_validate_nvm_checksum_with_offset");
- for (i = offset; i < ((NVM_CHECKSUM_REG + offset) + 1); i++) {
+ for (i = offset; i < (u16)((NVM_CHECKSUM_REG + offset) + 1); i++) {
ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
if (ret_val) {
DEBUGOUT("NVM Read Error\n");
@@ -2432,7 +2432,7 @@ s32 e1000_update_nvm_checksum_with_offset(struct e1000_hw *hw, u16 offset)
DEBUGFUNC("e1000_update_nvm_checksum_with_offset");
- for (i = offset; i < (NVM_CHECKSUM_REG + offset); i++) {
+ for (i = offset; i < (u16)(NVM_CHECKSUM_REG + offset); i++) {
ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
if (ret_val) {
DEBUGOUT("NVM Read Error while updating checksum.\n");
diff --git a/drivers/net/intel/e1000/base/e1000_manage.c b/drivers/net/intel/e1000/base/e1000_manage.c
index 4b81028302..71df2890f3 100644
--- a/drivers/net/intel/e1000/base/e1000_manage.c
+++ b/drivers/net/intel/e1000/base/e1000_manage.c
@@ -129,7 +129,7 @@ bool e1000_enable_tx_pkt_filtering_generic(struct e1000_hw *hw)
len = E1000_MNG_DHCP_COOKIE_LENGTH >> 2;
offset = E1000_MNG_DHCP_COOKIE_OFFSET >> 2;
for (i = 0; i < len; i++)
- *(buffer + i) = E1000_READ_REG_ARRAY_DWORD(hw, E1000_HOST_IF,
+ buffer[i] = E1000_READ_REG_ARRAY_DWORD(hw, E1000_HOST_IF,
offset + i);
hdr_csum = hdr->checksum;
hdr->checksum = 0;
@@ -173,7 +173,7 @@ s32 e1000_mng_write_cmd_header_generic(struct e1000_hw *hw,
/* Write the relevant command block into the ram area. */
for (i = 0; i < length; i++) {
E1000_WRITE_REG_ARRAY_DWORD(hw, E1000_HOST_IF, i,
- *((u32 *) hdr + i));
+ ((u32 *)hdr)[i]);
E1000_WRITE_FLUSH(hw);
}
--
2.43.0
next prev parent reply other threads:[~2026-05-20 12:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 12:52 [PATCH 00/10] e1000 base code update Ciara Loftus
2026-05-20 12:52 ` [PATCH 01/10] net/e1000/base: refactor K1 exit timeout configuration Ciara Loftus
2026-05-20 12:52 ` [PATCH 02/10] net/e1000/base: fix typo in e1000 base code Ciara Loftus
2026-05-20 12:52 ` [PATCH 03/10] net/e1000/base: fix possible variable overflow Ciara Loftus
2026-05-20 12:52 ` [PATCH 04/10] net/e1000/base: reclassify MAC type Ciara Loftus
2026-05-20 12:52 ` [PATCH 05/10] net/e1000/base: clear DPG enable bit post MAC reset Ciara Loftus
2026-05-21 16:42 ` Bruce Richardson
2026-05-20 12:52 ` [PATCH 06/10] net/e1000/base: fix coding style issues Ciara Loftus
2026-05-20 12:52 ` Ciara Loftus [this message]
2026-05-20 12:52 ` [PATCH 08/10] net/e1000/base: propagate PHY control register write error Ciara Loftus
2026-05-20 12:52 ` [PATCH 09/10] net/e1000/base: auto-negotiation status for 1000BASE-T Ciara Loftus
2026-05-20 12:52 ` [PATCH 10/10] net/e1000/base: update version info Ciara Loftus
2026-05-21 16:47 ` [PATCH 00/10] e1000 base code update Bruce Richardson
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=20260520125256.354336-8-ciara.loftus@intel.com \
--to=ciara.loftus@intel.com \
--cc=dev@dpdk.org \
--cc=dima.ruinskiy@intel.com \
--cc=menachem.fogel@intel.com \
--cc=stable@dpdk.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox