diff options
| author | Adrian Korwel <adriank20047@gmail.com> | 2026-05-25 09:58:31 -0500 |
|---|---|---|
| committer | Johan Hovold <johan@kernel.org> | 2026-06-02 12:08:52 +0200 |
| commit | 183c1076eca43bbb3e7bdf597456f91d81c73e74 (patch) | |
| tree | ecf0a8d3c66ed1ee000aac8aa9107b1608121dee /Documentation/arm64/git@git.tavy.me:linux.git | |
| parent | e43ffb69e0438cddd72aaa30898b4dc446f664f8 (diff) | |
USB: serial: io_ti: fix heap overflow in get_manuf_info()
get_manuf_info() reads le16_to_cpu(rom_desc->Size) bytes from the
device I2C EEPROM into a buffer allocated with kmalloc_obj(), which
is sizeof(struct edge_ti_manuf_descriptor) = 10 bytes.
The Size field comes from the device and is only validated (in
check_i2c_image()) to make sure the descriptor fits within
TI_MAX_I2C_SIZE (16384 bytes), not against the destination buffer size.
A malicious USB device can therefore set Size to any value up to 16377,
causing a heap overflow of up to 16367 bytes when plugged into a host
running this driver.
valid_csum() is called after read_rom() and also iterates
buffer[0..Size-1], compounding the out-of-bounds access.
Fix by rejecting descriptors with unexpected length before calling
read_rom().
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Korwel <adriank20047@gmail.com>
[ johan: amend commit message; also check for short descriptors ]
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'Documentation/arm64/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
