scsi: ufs: core: Validate string descriptors
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4b828fe156a662a4b6135019bf077040340f299b · < d96e83d028d7d8762e424e49c671d49ac2ecf14f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
scsi: ufs: core: Validate string descriptors
The string descriptor length includes a two-byte header while the UTF-16 payload starts after it. utf16s_to_utf8s() expects a count of UTF-16 code units, not bytes. Passing the payload byte count can make it read beyond the descriptor buffer.
Validate that the payload has an even byte count, pass a code-unit count to the converter, and allocate sufficient UTF-8 output space.
The raw string buffer starts after the descriptor header but its size is bLength. Copying bLength bytes from that pointer can read beyond the response buffer.
Allocate a zeroed bLength-sized buffer and copy only the UTF-16 payload. This preserves the raw buffer size consumed by the RPMB device-ID ABI while avoiding the overread.
From the CVE record · Linux
The Linux kernel UFS driver can read beyond a descriptor or response buffer when processing string descriptors. A malformed descriptor could trigger these reads; the input does not specify how an attacker could supply one or whether authentication or user interaction is required.
Engineers running Linux kernels with the UFS driver should check their versions; affected versions are not specified.