iio: chemical: mhz19b: reject oversized serial replies
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.357.0.127.1In the Linux kernel, the following vulnerability has been resolved:
iio: chemical: mhz19b: reject oversized serial replies
mhz19b_receive_buf() appends each serdev chunk into the fixed MHZ19B_CMD_SIZE receive buffer and advances buf_idx by len without checking that the chunk fits in the remaining space. A large callback can therefore overflow st->buf before the command path validates the reply.
Reset the reply state before each command and reject oversized serial replies before copying them into the fixed buffer. When an oversized reply is detected, wake the waiter and report -EMSGSIZE instead of overwriting st->buf.
From the CVE record · Linux
The Linux kernel’s mhz19b driver can copy an oversized serial reply beyond a fixed receive buffer. This can happen when a serial callback delivers more data than the buffer has room for; the input does not specify attacker access requirements or user interaction.
Engineers running Linux kernels that include the affected mhz19b driver should check their kernel version against the vendor advisory.