Dan Carpenter 690b2549b1 i2c: ismt: prevent memory corruption in ismt_access()
The "data->block[0]" variable comes from the user and is a number
between 0-255.  It needs to be capped to prevent writing beyond the end
of dma_buffer[].

Fixes: 5e9a97b1f449 ("i2c: ismt: Adding support for I2C_SMBUS_BLOCK_PROC_CALL")
Reported-and-tested-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-06-02 08:40:56 -07:00
..
2020-09-27 15:14:16 +02:00
2021-04-14 10:20:00 +02:00
2021-01-05 17:30:45 +01:00
2021-08-19 19:18:24 +02:00
2021-08-19 19:18:17 +02:00
2022-05-21 13:33:25 +02:00
2021-04-14 10:20:45 +02:00
2022-05-31 14:34:00 -07:00
2021-10-02 09:32:06 +02:00
2022-05-31 14:34:00 -07:00
2022-03-01 16:05:01 +01:00
2021-08-19 19:18:24 +02:00
2021-04-17 22:00:58 +02:00
2022-01-14 18:50:52 -05:00
2021-11-23 10:00:12 +01:00