From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@kernel.org, andrew+netdev@lunn.ch,
netdev@vger.kernel.org
Cc: Linkui Xiao <xiaolinkui@kylinos.cn>,
anthony.l.nguyen@intel.com, ripatel@wii.dev, xiaolinkui@126.com,
tomasz.lichwala@linux.intel.com, runyu.xiao@seu.edu.cn,
jedrzej.jagielski@intel.com,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
Alexander Nowlin <alexander.nowlin@intel.com>
Subject: [PATCH net 2/4] ixgbe: fix incomplete ACI command buffer backup on retry
Date: Fri, 20 Nov 2026 14:00:18 -0800 [thread overview]
Message-ID: <20261120220022.3133664-3-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20261120220022.3133664-1-anthony.l.nguyen@intel.com>
From: Linkui Xiao <xiaolinkui@kylinos.cn>
ixgbe_aci_send_cmd() saves only the first byte of the caller's buffer
before an EBUSY retry, using kmalloc() plus a single-byte store. When
retries are exhausted, the caller's output buffer is filled with
uninitialized slab bytes, because only the first byte was saved before
the retry. The firmware itself does not see this data, since the
retryable opcodes do not set LIBIE_AQ_FLAG_RD, but the caller still
receives garbage in its output buffer.
Replace the kmalloc() plus single-byte store with kmemdup() so the whole
indirect command buffer is saved before an EBUSY retry, skip the backup
when buf_size is 0, and key the restore off buf_cpy instead of buf,
exactly like ice_sq_send_cmd_retry() already does.
Fixes: c9e563cae19e ("ixgbe: add support for devlink reload")
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Linkui Xiao <xiaolinkui@kylinos.cn>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Alexander Nowlin <alexander.nowlin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
index da8519065d81..a6dc214f7771 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
@@ -214,11 +214,10 @@ int ixgbe_aci_send_cmd(struct ixgbe_hw *hw, struct libie_aq_desc *desc,
is_cmd_for_retry = ixgbe_should_retry_aci_send_cmd_execute(opcode);
if (is_cmd_for_retry) {
- if (buf) {
- buf_cpy = kmalloc(buf_size, GFP_KERNEL);
+ if (buf && buf_size) {
+ buf_cpy = kmemdup(buf, buf_size, GFP_KERNEL);
if (!buf_cpy)
return -ENOMEM;
- *buf_cpy = *(u8 *)buf;
}
desc_cpy = *desc;
}
@@ -234,7 +233,7 @@ int ixgbe_aci_send_cmd(struct ixgbe_hw *hw, struct libie_aq_desc *desc,
last_status != LIBIE_AQ_RC_EBUSY)
break;
- if (buf)
+ if (buf_cpy)
memcpy(buf, buf_cpy, buf_size);
*desc = desc_cpy;
--
2.47.1
next prev parent reply other threads:[~2026-11-20 22:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 22:00 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) Tony Nguyen
2026-11-20 22:00 ` [PATCH net 1/4] ixgbe: fix MDIO bus lifetime Tony Nguyen
2026-11-20 22:00 ` Tony Nguyen [this message]
2026-11-20 22:00 ` [PATCH net 3/4] ixgbevf: fix link speed reporting for Hyper-V E610 VFs Tony Nguyen
2026-11-20 22:00 ` [PATCH net 4/4] net: fm10k: shut down the service timer during removal Tony Nguyen
2026-11-20 22:03 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) netdev-bot+sinfo
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=20261120220022.3133664-3-anthony.l.nguyen@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=alexander.nowlin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=jedrzej.jagielski@intel.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=ripatel@wii.dev \
--cc=runyu.xiao@seu.edu.cn \
--cc=tomasz.lichwala@linux.intel.com \
--cc=xiaolinkui@126.com \
--cc=xiaolinkui@kylinos.cn \
/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