summaryrefslogtreecommitdiff
path: root/fs/afs
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2020-06-13 11:41:09 +0100
committerSasha Levin <sashal@kernel.org>2020-06-30 15:37:02 -0400
commit5cee9e67596f7d694e94d7def7cd9d65a7599f66 (patch)
tree403fe3a45f45c7d4276ad5bbd912c807ce838a86 /fs/afs
parent4a6e6413059e8cbacb99ce797ec447612f407e43 (diff)
i2c: core: check returned size of emulated smbus block read
[ Upstream commit 40e05200593af06633f64ab0effff052eee6f076 ] If the i2c bus driver ignores the I2C_M_RECV_LEN flag (as some of them do), it is possible for an I2C_SMBUS_BLOCK_DATA read issued on some random device to return an arbitrary value in the first byte (and nothing else). When this happens, i2c_smbus_xfer_emulated() will happily write past the end of the supplied data buffer, thus causing Bad Things to happen. To prevent this, check the size before copying the data block and return an error if it is too large. Fixes: 209d27c3b167 ("i2c: Emulate SMBus block read over I2C") Signed-off-by: Mans Rullgard <mans@mansr.com> [wsa: use better errno] Signed-off-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/afs')
0 files changed, 0 insertions, 0 deletions