From: Linkui Xiao <xiaolinkui@126.com>
To: netdev-bot+sashiko@kernel.org
Cc: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com,
intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, xiaolinkui@kylinos.cn,
aleksandr.loktionov@intel.com
Subject: Re: [Intel-wired-lan] [PATCH net v2] i40e: limit the DDP profile count returned by the firmware
Date: Tue, 22 Sep 2026 17:03:42 +0800 [thread overview]
Message-ID: <ef2b48b9-0f57-46e6-8209-8f4b9d6e42dd@126.com> (raw)
In-Reply-To: <178997248483.2160803.11710552261264563604@kernel.org>
Thanks for the review. Both findings are addressed in v3.
- [Medium] Incomplete fix in i40e_ddp_does_profile_exist() and
i40e_ddp_does_profile_overlap()
Agreed on the clamping half. Silently limiting the count and then
returning 0 hands i40e_ddp_load() a definite answer derived from a list
that was only partially read: the add path proceeds without having
examined every profile the firmware reported, and the is_add == false
path reports a profile as missing that may in fact be loaded. Both
helpers already have an error return that i40e_ddp_load() turns into
"Failed to fetch loaded profiles." and aborts the operation, so v3
rejects the list instead: if the firmware reports more profiles than
I40E_PROFILE_LIST_SIZE can hold, the helpers return -EIO and no scan
happens at all.
I did not plumb the response datalen out of i40e_aq_get_ddp_list().
For this command the driver has to set desc.datalen to the buffer size
it passes in, and i40e_aq_get_ddp_list() does not report the writeback
descriptor back to its caller, so the length would have to come either
from a new output parameter on that helper (declared in
i40e_prototype.h) or from a wb_desc routed through cmd_details. Either
way it adds a second firmware supplied number to validate on top of the
one this patch is about, and if the firmware leaves the field at the
requested 772 bytes the derived bound is exactly the bound we have
today. That is a bigger change to the common AQ path than a net fix
should carry, so I would rather bound the scan by the size of the
buffer the driver owns.
The remaining half - comparing against p_info[] slots the firmware
never filled - cannot be detected independently of the count, because
the driver is not told how many records were actually written. If the
firmware reports a count of 16 or less while writing fewer records, the
unread slots are indistinguishable from real entries. Zero
initialization makes the outcome deterministic (an unwritten entry is
all zeroes rather than stale stack) but does not make it correct;
deriving the bound from the response length would be needed for that,
and that is the larger helper change described above.
- [Medium, pre-existing] uninitialized buff[] handed to
i40e_aq_get_ddp_list()
Agreed, and fixed as suggested: buff[] is now zero initialized in both
helpers. i40e_asq_send_command_atomic_exec() copies the full buff_size
into the DMA bounce buffer and copies the full buff_size back on
completion, so those 772 bytes of stack were both readable by the
firmware and compared against afterwards. Both hunks touch these
declarations and the root commit is the same (cdc594e00370), so it is
handled here rather than as a separate patch; I can split it out if you
would rather have it on its own.
v3 keeps the unsigned loop counter from v2, and drops the Reviewed-by tag,
as the code changed after the review.
pw-bot: cr
prev parent reply other threads:[~2026-09-22 9:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 6:32 [Intel-wired-lan] [PATCH net v2] i40e: limit the DDP profile count returned by the firmware Linkui Xiao
2026-09-21 6:34 ` netdev-bot+sashiko
2026-09-22 9:03 ` Linkui Xiao [this message]
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=ef2b48b9-0f57-46e6-8209-8f4b9d6e42dd@126.com \
--to=xiaolinkui@126.com \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.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