UPSTREAM: i2c: ismt: prevent memory corruption in ismt_access()
commit 690b2549 upstream. 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[]. Bug: 247008437 Fixes: 5e9a97b1 ("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> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Lee Jones <joneslee@google.com> Change-Id: I16cefa30f259ccd57147ff1d3e9747c36e3ed5f9
Loading
Please sign in to comment