Description
In the Linux kernel, the following vulnerability has been resolved: HID: mcp2221: clear rxbuf after I2C/SMBus transfer completes mcp_i2c_smbus_read() stores the caller-supplied buffer pointer in mcp->rxbuf for the duration of a transfer but never clears it when the transfer finishes or times out. Once the caller frees or reuses the buffer, mcp->rxbuf becomes a dangling pointer. A delayed or spurious MCP2221_I2C_GET_DATA report can then drive mcp2221_raw_event() to memcpy device data into the freed memory, causing a write use-after-free. Route all return paths through a single exit point that clears mcp->rxbuf and mcp->rxbuf_size, so that the existing !mcp->rxbuf guard in the raw_event handler can reject any report arriving after the transfer has ended.
Affected products
Version statuses are supplied by the assigning organization. Consult the original record for detailed ranges and platform conditions.
Linux Linux
Default version status: unaffected
67a95c21463d066060b0f66d65a75d45bb386ffb to < bd146a8ff107c6d77e75597decbcd1df0d7900d6affected67a95c21463d066060b0f66d65a75d45bb386ffb to < d6c6b293173c0ea87189501cbd77e8fa677814a1affected67a95c21463d066060b0f66d65a75d45bb386ffb to < 03c34309eb1bce1b3b5f7c4a94b703f419120383affected67a95c21463d066060b0f66d65a75d45bb386ffb to < 968546b676d992dd1da3e057d40598231f725996affected67a95c21463d066060b0f66d65a75d45bb386ffb to < db2333f88729c8aae062cb171ed058725ff5c901affected
Linux Linux
Default version status: affected
5.7affected0 to < 5.7unaffected6.6.160 to ≤ 6.6.*unaffected6.12.111 to ≤ 6.12.*unaffected6.18.51 to ≤ 6.18.*unaffected7.2.4 to ≤ 7.2.*unaffected7.3 to ≤ *unaffected
References
- https://git.kernel.org/stable/c/bd146a8ff107c6d77e75597decbcd1df0d7900d6 ↗
- https://git.kernel.org/stable/c/d6c6b293173c0ea87189501cbd77e8fa677814a1 ↗
- https://git.kernel.org/stable/c/03c34309eb1bce1b3b5f7c4a94b703f419120383 ↗
- https://git.kernel.org/stable/c/968546b676d992dd1da3e057d40598231f725996 ↗
- https://git.kernel.org/stable/c/db2333f88729c8aae062cb171ed058725ff5c901 ↗