From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: Guangshuo Li <lgs201920130244@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Florian Westphal <fw@strlen.de>,
<intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH] e1000: fix OOB in e1000_tbi_should_accept()
Date: Tue, 25 Nov 2025 14:43:03 -0800 [thread overview]
Message-ID: <90bdad3c-0363-4f0f-b7df-f533e0db7e0d@intel.com> (raw)
In-Reply-To: <CANUHTR8QDRPZE1b8msLC2WXkdjSjn_+6co0RzsLy7BPENUxjYQ@mail.gmail.com>
On 11/23/2025 7:45 PM, Guangshuo Li wrote:
> Hi Tony, all,
>
> Thanks for the review. As suggested by Tony, I’ll keep the declarations
> at the top and place the bounds checks before assigning last_byte. I’ll
> send a v2 with the following change:
>
> static bool e1000_tbi_should_accept(struct e1000_adapter *adapter,
> u8 status, u8 errors,
> u32 length, const u8 *data)
> {
> struct e1000_hw *hw = &adapter->hw;
> u8 last_byte;
>
> /* Guard against OOB on data[length - 1] */
> if (unlikely(!length))
> return false;
>
> /* Upper bound: length must not exceed rx_buffer_len */
> if (unlikely(length > adapter->rx_buffer_len))
> return false;
>
> last_byte = data[length - 1];
>
> /* existing logic follows ... */
> }
> Please let me know if further adjustments are preferred.
This looks along the lines of what I was expecting.
Thanks,
Tony
> Best regards,
> Guangshuo Li
prev parent reply other threads:[~2025-11-25 22:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-04 8:28 Guangshuo Li
2025-11-05 7:25 ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-11-17 23:24 ` Tony Nguyen
[not found] ` <CANUHTR8QDRPZE1b8msLC2WXkdjSjn_+6co0RzsLy7BPENUxjYQ@mail.gmail.com>
2025-11-25 22:43 ` Tony Nguyen [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=90bdad3c-0363-4f0f-b7df-f533e0db7e0d@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=fw@strlen.de \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=lgs201920130244@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.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
all inboxes | Powered by JetHome®