mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: <pavankumaryalagada@gmail.com>, <przemyslaw.kitszel@intel.com>
Cc: <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>, <skhan@linuxfoundation.org>,
	<syzbot+e0abb1d45ac291ebebeb@syzkaller.appspotmail.com>,
	<kohei@enjuk.jp>, <aleksandr.loktionov@intel.com>
Subject: Re: [PATCH net v3] e100: prevent shift-out-of-bounds in EEPROM access
Date: Wed, 19 Aug 2026 16:57:44 -0700	[thread overview]
Message-ID: <b7ca66c7-88a1-440a-af39-5c710577294a@intel.com> (raw)
In-Reply-To: <20260816113754.22900-1-pavankumaryalagada@gmail.com>



On 8/16/2026 4:37 AM, pavankumaryalagada@gmail.com wrote:
> From: Yalagada Pavan Kumar <pavankumaryalagada@gmail.com>
> 
> When reading the EEPROM address length, e100_eeprom_read() can return
> an invalid length. This value is then used as a shift count when
> calculating eeprom_wc, resulting in a shift-out-of-bounds UBSAN warning.
> 
> Stop EEPROM address probing if the detected address length exceeds
> the initial address length to prevent addr_len from underflowing.
> 
> Validate addr_len after reading it from the EEPROM in both
> e100_eeprom_load() and e100_eeprom_save(), and return -EIO
> if the value is zero or greater than 8.
> 
> Reported-by: syzbot+e0abb1d45ac291ebebeb@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=e0abb1d45ac291ebebeb
> Signed-off-by: Yalagada Pavan Kumar <pavankumaryalagada@gmail.com>
> ---
> v3:
>   - Prevent addr_len underflow during EEPROM probing.
>   - Use BIT() and explicitly cast the result to u16 when assigning eeprom_wc.
>   - Update the commit message and subject to reflect the scope of the fix.
>   - verify the UBSAN failure with syzkaller reproducer before the fix
>     and its absence after the fix.
> 
> v2: https://lore.kernel.org/all/20260810083355.21631-1-pavankumaryalagada@gmail.com/
>   - Return -EIO instead of -EINVAL for an invalid EEPROM address length.
>   - Validate addr_len in e100_eeprom_save() as well.
>   - Drop the unnecessary 1U change in the shift.
>   - Update the commit message.
> 
> v1: https://lore.kernel.org/all/20260807145626.52692-1-pavankumaryalagada@gmail.com/
> ---
>   drivers/net/ethernet/intel/e100.c | 16 +++++++++-------
>   1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
> index 464dc2d6cdb5..5165f1d3c98f 100644
> --- a/drivers/net/ethernet/intel/e100.c
> +++ b/drivers/net/ethernet/intel/e100.c
> @@ -746,10 +746,12 @@ static __le16 e100_eeprom_read(struct nic *nic, u16 *addr_len, u16 addr)
>   		if (!(ctrl & eedo) && i > 16) {
>   			u16 len = i - 16;
>   
> -			if (len > *addr_len)
> +			if (len > *addr_len) {
>   				*addr_len = 0;
> -			else
> -				*addr_len -= len;
> +				break;
> +			}
> +
> +			*addr_len -= len;
>   			i = 17;

It seems each version you are sending is change on top of the previous 
version. Please send all the changes in a single patch so that it can be 
reviewed, and applied, standalone.

Also, Andrew had requested on the other patch that this go via *-next 
since the issue is a theoretical one. Can you target this to iwl-next?

Thanks,
Tony

>   		}
>   

      reply	other threads:[~2026-08-19 23:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-16 11:37 pavankumaryalagada
2026-08-19 23:57 ` 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=b7ca66c7-88a1-440a-af39-5c710577294a@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kohei@enjuk.jp \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavankumaryalagada@gmail.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=skhan@linuxfoundation.org \
    --cc=syzbot+e0abb1d45ac291ebebeb@syzkaller.appspotmail.com \
    /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®