aboutsummaryrefslogtreecommitdiff
path: root/net/lapb/lapb_timer.c
diff options
context:
space:
mode:
authorJonas Malaco <[email protected]>2022-02-03 13:49:52 -0300
committerGreg Kroah-Hartman <[email protected]>2022-02-04 16:27:44 +0100
commitc0689e46be23160d925dca95dfc411f1a0462708 (patch)
tree2246752f24ddeb0d5b50d8f7de626259dfdd8906 /net/lapb/lapb_timer.c
parent46963e2e0629cb31c96b1d47ddd89dc3d8990b34 (diff)
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: [email protected] Reviewed-by: Heiner Kallweit <[email protected]> Signed-off-by: Jonas Malaco <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions