Centos-kernel-stream-9/drivers/misc/eeprom
David Arcari 60049987d6 eeprom: ee1004: limit i2c reads to I2C_SMBUS_BLOCK_MAX
Bugzilla: https://bugzilla.redhat.com/2040028

commit c0689e46be23160d925dca95dfc411f1a0462708
Author: Jonas Malaco <jonas@protocubo.io>
Date:   Thu Feb 3 13:49:52 2022 -0300

    eeprom: ee1004: limit i2c reads to I2C_SMBUS_BLOCK_MAX

    Commit effa453168a7 ("i2c: i801: Don't silently correct invalid transfer
    size") revealed that ee1004_eeprom_read() did not properly limit how
    many bytes to read at once.

    In particular, i2c_smbus_read_i2c_block_data_or_emulated() takes the
    length to read as an u8.  If count == 256 after taking into account the
    offset and page boundary, the cast to u8 overflows.  And this is common
    when user space tries to read the entire EEPROM at once.

    To fix it, limit each read to I2C_SMBUS_BLOCK_MAX (32) bytes, already
    the maximum length i2c_smbus_read_i2c_block_data_or_emulated() allows.

    Fixes: effa453168a7 ("i2c: i801: Don't silently correct invalid transfer size")
    Cc: stable@vger.kernel.org
    Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
    Signed-off-by: Jonas Malaco <jonas@protocubo.io>
    Link: https://lore.kernel.org/r/20220203165024.47767-1-jonas@protocubo.io
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-04-01 09:23:17 -04:00
..
Kconfig nvmem: prepare basics for FRAM support 2021-06-11 12:23:10 +02:00
Makefile
at24.c misc: eeprom: at24: Always append device id even if label property is set. 2021-07-01 18:49:37 +02:00
at25.c nvmem: eeprom: at25: fram discovery simplification 2021-06-12 15:34:17 +02:00
digsy_mtc_eeprom.c
ee1004.c eeprom: ee1004: limit i2c reads to I2C_SMBUS_BLOCK_MAX 2022-04-01 09:23:17 -04:00
eeprom.c misc: eeprom: use helper to get i2c_client from kobj 2020-09-21 11:45:43 +02:00
eeprom_93cx6.c
eeprom_93xx46.c misc: eeprom_93xx46: Add new 93c56 and 93c66 compatible strings 2021-05-14 13:45:24 +02:00
idt_89hpesx.c eeprom: idt_89hpesx: use SPDX-License-Identifier 2021-06-09 18:39:40 +02:00
max6875.c