From: Kevin Traynor <ktraynor@redhat.com>
To: Bruce Richardson <bruce.richardson@intel.com>, stable@dpdk.org
Cc: Fabio Pricoco <fabio.pricoco@intel.com>,
Jacob Keller <jacob.e.keller@intel.com>,
Soumyadeep Hore <soumyadeep.hore@intel.com>
Subject: Re: [PATCH 21.11] net/ice/base: fix iteration of TLVs in Preserved Fields Area
Date: Wed, 4 Dec 2024 15:56:35 +0000 [thread overview]
Message-ID: <c0c36cb9-248d-439f-8991-a41af9c0aaff@redhat.com> (raw)
In-Reply-To: <20241204135625.2841607-1-bruce.richardson@intel.com>
On 04/12/2024 14:56, Bruce Richardson wrote:
> From: Fabio Pricoco <fabio.pricoco@intel.com>
>
> Backport of commit dcb760bf0f95 ("net/ice/base: fix iteration of TLVs in
> Preserved Fields Area"), for 21.11 release, replacing the use of
> __builtin_add_overflow with an inline function to avoid breaking
> RHEL/Centos 7.
>
> The ice_get_pfa_module_tlv() function iterates over the Preserved Fields
> Area to read data from the Shadow RAM, including the Part Board Assembly
> data, among others.
>
> If the specific TLV being requested is not found in the current NVM, the
> code will read past the end of the PFA, misinterpreting the last word of
> the PFA and the word just after the PFA as another TLV. This typically
> results in one extra iteration before the length check of the while loop
> is triggered.
>
> Correct the logic for determining the maximum PFA offset to include the
> extra last word. Additionally, make the driver robust against overflows
> by using check_add_overflow. This ensures that even if the NVM provides
> bogus data, the driver will not overflow, and will instead log a useful
> warning message. The check for whether the TLV length exceeds the PFA
> length is also removed, in favor of relying on the overflow warning
> instead.
>
> Fixes: 5d0b7b5fc491 ("net/ice/base: add read PBA module function")
> Cc: stable@dpdk.org
>
> Signed-off-by: Fabio Pricoco <fabio.pricoco@intel.com>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Signed-off-by: Soumyadeep Hore <soumyadeep.hore@intel.com>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> drivers/net/ice/base/ice_nvm.c | 43 ++++++++++++++++++++++++----------
> 1 file changed, 31 insertions(+), 12 deletions(-)
>
Thanks Bruce - applied and pushed to 21.11 branch.
prev parent reply other threads:[~2024-12-04 15:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 13:56 Bruce Richardson
2024-12-04 15:56 ` Kevin Traynor [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=c0c36cb9-248d-439f-8991-a41af9c0aaff@redhat.com \
--to=ktraynor@redhat.com \
--cc=bruce.richardson@intel.com \
--cc=fabio.pricoco@intel.com \
--cc=jacob.e.keller@intel.com \
--cc=soumyadeep.hore@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;
as well as URLs for NNTP newsgroup(s).