diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-06-02 14:02:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-06 08:43:37 +0200 |
commit | 24c6fc6e7453f64cf6cbb4218c62aafdecc16ee1 (patch) | |
tree | afb11cf16524c0a0d6b99c1dfd534ee615d726da /lib/assoc_array.c | |
parent | f692bcffd1f2ce5488d24fbcb8eab5f351abf79d (diff) |
i2c: ismt: prevent memory corruption in ismt_access()
commit 690b2549b19563ec5ad53e5c82f6a944d910086e 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[].
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/assoc_array.c')
0 files changed, 0 insertions, 0 deletions