๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
5 messages
5 total messages Started by Tony Nguyen Fri, 13 Nov 2026 00:58
[PATCH net 1/3] e1000e: fix incorrect modified flag check in e1000_read_nvm_spt()
#15563
Author: Tony Nguyen
Date: Fri, 13 Nov 2026 00:58
50 lines
11375 bytes
From: Ivy Lopez <skunkolee@gmail.com>

e1000_read_nvm_spt() reads two adjacent 16-bit NVM words as one
32-bit dword for efficiency. When deciding whether to use the
shadow RAM value for the high word (data[i + 1]), it incorrectly
checks the "modified" flag of the low word (shadow_ram[offset + i])
instead of the high word's own flag (shadow_ram[offset + i + 1]).

This can cause silent NVM shadow RAM corruption:
 - if only the high word is marked modified, its pending write is
   lost and the stale flash value is returned instead
 - if only the low word is marked modified, the high word is
   incorrectly overwritten with the low word's shadow value

This function is used on all PCH chips from SPT onward (SPT, CNP,
TGP, ADP, MTP, etc). The bug has been present since the dword-read
optimization was introduced for these chips.

Note: this was found via code review while investigating a separate
reproducible packet loss issue on I219-LM (SPT+ PCH). Testing showed
this fix does not resolve that particular symptom, but the flag
check is still a genuine logic bug that can corrupt shadow RAM
contents and should be fixed regardless.

Fixes: 79849ebc0e06 ("e1000e: initial support for i219")
Signed-off-by: Ivy Lopez <skunkolee@gmail.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Tested-by: Moriya Kadosh <moriyax.kadosh@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/e1000e/ich8lan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index aa90e0ce8aca..87cd1cdc6f10 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -3473,7 +3473,7 @@ static s32 e1000_read_nvm_spt(struct e1000_hw *hw, u16 offset, u16 words,
 				    dev_spec->shadow_ram[offset + i].value;
 			else
 				data[i] = (u16)(dword & 0xFFFF);
-			if (dev_spec->shadow_ram[offset + i].modified)
+			if (dev_spec->shadow_ram[offset + i + 1].modified)
 				data[i + 1] =
 				    dev_spec->shadow_ram[offset + i + 1].value;
 			else
-- 
2.47.1
Re: [PATCH net 1/3] e1000e: fix incorrect modified flag check in e1000_read_nvm_spt()
#15569
Author: netdev-bot+sinfo
Date: Fri, 13 Nov 2026 01:12
26 lines
9047 bytes
Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by LLM and not proven at runtime). If it was triggered
   please include the symptoms, like the stack trace or kernel messages.

 - What hardware the change was tested on. For driver fixes please
   mention the device (and if relevant firmware version) used for
   testing, or say that the change was not tested on real hardware.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.

The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
Re: [PATCH net 1/3] e1000e: fix incorrect modified flag check in e1000_read_nvm_spt()
#16106
Author: netdev-bot+sashiko
Date: Sat, 14 Nov 2026 01:11
101 lines
12198 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The commit message overstates what the patch fixes.
- [Low] The second failure-mode bullet in the commit message is wrong.

--

e1000e: fix incorrect modified flag check in e1000_read_nvm_spt()

This patch changes the two-word branch of e1000_read_nvm_spt(). The high
word (data[i + 1]) is now taken from shadow RAM based on its own modified
flag, shadow_ram[offset + i + 1], instead of the low word's flag. The
commit message calls this a fix for silent NVM shadow RAM corruption on
SPT and later PCH parts.

> This can cause silent NVM shadow RAM corruption:
>  - if only the high word is marked modified, its pending write is
>    lost and the stale flash value is returned instead
>  - if only the low word is marked modified, the high word is
>    incorrectly overwritten with the low word's shadow value

[Severity: Low]
Is the second case described accurately? The pre-patch code was:

    if (dev_spec->shadow_ram[offset + i].modified)
        data[i + 1] =
            dev_spec->shadow_ram[offset + i + 1].value;

The assigned value comes from the high word's own entry
(offset + i + 1), not from the low word's entry.

Unmodified entries hold 0xFFFF. e1000_init_nvm_params_ich8lan() sets
them that way, and they are reset the same way after each commit:

    for (i = 0; i < nvm->word_size; i++) {
        dev_spec->shadow_ram[i].modified = false;
        dev_spec->shadow_ram[i].value = 0xFFFF;
    }

So when only the low word was modified, wouldn't the old code return
0xFFFF for the high word, not the low word's pending value?

> This function is used on all PCH chips from SPT onward (SPT, CNP,
> TGP, ADP, MTP, etc). The bug has been present since the dword-read
> optimization was introduced for these chips.
>
> Note: this was found via code review while investigating a separate
> reproducible packet loss issue on I219-LM (SPT+ PCH). Testing showed
> this fix does not resolve that particular symptom, but the flag
> check is still a genuine logic bug that can corrupt shadow RAM
> contents and should be fixed regardless.
>
> Fixes: 79849ebc0e06 ("e1000e: initial support for i219")

[Severity: Medium]
Can any in-tree caller reach the changed line on SPT+ parts?

The only way into e1000_read_nvm_spt() is hw->nvm.ops.read, through
e1000_read_nvm(). Every e1000_read_nvm() call in e1000e passes words=1,
except the one in e1000_get_eeprom():

    if (hw->nvm.type == e1000_nvm_eeprom_spi) {
        ret_val = e1000_read_nvm(hw, first_word,
                                 last_word - first_word + 1,
                                 eeprom_buff);
    } else {
        for (i = 0; i < last_word - first_word + 1; i++) {
            ret_val = e1000_read_nvm(hw, first_word + i, 1,
                                     &eeprom_buff[i]);

e1000_init_nvm_params_ich8lan() sets nvm->type = e1000_nvm_flash_sw for
every ICH/PCH/SPT+ part, so these parts never use the multi-word read.

With words=1, the loop in e1000_read_nvm_spt() runs once with i=0. It
takes the words - i == 1 branch, which already checks
shadow_ram[offset + i].modified correctly.

Also, e1000_read_nvm_spt() never writes shadow_ram. The only writers are
e1000_init_nvm_params_ich8lan(), e1000_write_nvm_ich8lan(), and the
resets after a commit. Even with a multi-word caller, wouldn't the worst
case be a wrong value returned to that caller, not corrupted shadow RAM?

The code change looks correct, but it fixes a latent bug. With the
Fixes: tag, stable will likely take it as an active data-integrity fix.

Could the commit message say that no in-tree path reaches the two-word
branch today? It could also drop the "silent NVM shadow RAM corruption"
and "can corrupt shadow RAM contents" wording.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113005823.130021-2-anthony.l.nguyen%40intel.com
Re: [PATCH net 1/3] e1000e: fix incorrect modified flag check in e1000_read_nvm_spt()
#18236
Author: patchwork-bot+netdevbpf
Date: Wed, 18 Nov 2026 02:00
29 lines
9035 bytes
Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 12 Nov 2026 16:58:18 -0800 you wrote:
> From: Ivy Lopez <skunkolee@gmail.com>
> 
> e1000_read_nvm_spt() reads two adjacent 16-bit NVM words as one
> 32-bit dword for efficiency. When deciding whether to use the
> shadow RAM value for the high word (data[i + 1]), it incorrectly
> checks the "modified" flag of the low word (shadow_ram[offset + i])
> instead of the high word's own flag (shadow_ram[offset + i + 1]).
> 
> [...]

Here is the summary with links:
  - [net,1/3] e1000e: fix incorrect modified flag check in e1000_read_nvm_spt()
    (no matching commit)
  - [net,2/3] igb/igbvf: disable work items before device removal
    (no matching commit)
  - [net,3/3] net: e1000: fix warning in iounmap on probe failure
    https://git.kernel.org/netdev/net/c/cf704cc62ffa

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Re: [PATCH net 1/3] e1000e: fix incorrect modified flag check in e1000_read_nvm_spt()
#18238
Author: patchwork-bot+netdevbpf
Date: Wed, 18 Nov 2026 02:00
29 lines
9025 bytes
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 12 Nov 2026 16:58:18 -0800 you wrote:
> From: Ivy Lopez <skunkolee@gmail.com>
> 
> e1000_read_nvm_spt() reads two adjacent 16-bit NVM words as one
> 32-bit dword for efficiency. When deciding whether to use the
> shadow RAM value for the high word (data[i + 1]), it incorrectly
> checks the "modified" flag of the low word (shadow_ram[offset + i])
> instead of the high word's own flag (shadow_ram[offset + i + 1]).
> 
> [...]

Here is the summary with links:
  - [net,1/3] e1000e: fix incorrect modified flag check in e1000_read_nvm_spt()
    (no matching commit)
  - [net,2/3] igb/igbvf: disable work items before device removal
    https://git.kernel.org/netdev/net-next/c/5efe340e9ab9
  - [net,3/3] net: e1000: fix warning in iounmap on probe failure
    (no matching commit)

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads