ALSA: line6: Reject capture buffers smaller than two packets
NIST has received this entry but not started reviewing it.
In the Linux kernel, the following vulnerability has been resolved: ALSA: line6: Reject capture buffers smaller than two packets line6_capture_copy() splits the copy into the ALSA ring buffer once at the buffer end and wraps pos_done once, which is only correct when one packet holds at most buffer_size frames. The packet size comes from the device's endpoint, and the per-device hw structs allow 64-byte periods with periods_min 1, so a packet can be larger than the whole buffer. audio_in_callback() logs an oversized packet and then copies it anyway. The packet size is known at probe time, so constrain SNDRV_PCM_HW_PARAM_BUFFER_BYTES in snd_line6_capture_open() to at least twice the larger of the two endpoints' packet sizes. Two rather than one, because pos_done advances by the packet and wraps once, so a buffer of exactly one packet leaves the position unchanged after every packet. hw_params then rejects a buffer that cannot hold two packets, and the single wrap is valid for every configuration that gets through. Keep a guard in line6_capture_copy() that drops an oversized packet with a ratelimited error, for the case that should no longer be reachable. Reproduced on 7.3-rc7 with a USB/IP device presenting the GuitarPort interface layout and 1024-byte packets into a 128-byte buffer: ALSA logged "invalid position: pos = 224, buffer size = 32" and the driver logged "driver bug: len" on every following packet. With this patch a 1024-byte buffer is refused at hw_params, and a 2048-byte buffer streams for 30 s with no report and with the position moving inside the buffer.
New to this? Read how to keep your software updated.
The products and versions NIST lists as vulnerable, 2 products in all. If what you run is not listed it is probably not affected, but ask your provider if you are unsure.
| Product | Type | Vulnerable versions | Fixed in |
|---|---|---|---|
| Linux Linux | Software | from 705ececd1c60d0f5d6ef2a719008847883516970, before e5593f7cc02ce02e414df6afa8fb22ab471b15da; from 705ececd1c60d0f5d6ef2a719008847883516970, before 31041d36272c74903c2edc79c709adacc3efc532; from 705ececd1c60d0f5d6ef2a719008847883516970, before 78cf1c93eaa13f1cd4ebdfdcc3a410f63590c539; from 705ececd1c60d0f5d6ef2a719008847883516970, before ed4d8c52b322edf93113a6cd0234fe585d4d5b5e; from 705ececd1c60d0f5d6ef2a719008847883516970, before 3e7f477a9e56b627739832e6cf9b682693a474a9; from 705ececd1c60d0f5d6ef2a719008847883516970, before faf1f471319775e280d959ffbffaa44fd7e5f5b0; and 2 more | e5593f7cc02ce02e414df6afa8fb22ab471b15da; 31041d36272c74903c2edc79c709adacc3efc532; 78cf1c93eaa13f1cd4ebdfdcc3a410f63590c539; ed4d8c52b322edf93113a6cd0234fe585d4d5b5e |
| Linux Linux | Software | 2.6.30 | not recorded |
The 7.8 severity score (high) from the company that reported it, broken into what it means in practice. Red means it makes the flaw easier or worse.
| How it is reached | On the machine | The attacker needs access to the computer itself, for example a login or a file they can get you to open. |
| How hard it is | Low | Easy to carry out. No special conditions have to line up. |
| Login needed | Low | The attacker needs an ordinary user account. |
| Someone has to act | None | Nobody has to click or open anything. It can happen on its own. |
| Reaches beyond the program | Unchanged | The damage stays inside the vulnerable program. |
| Data exposed | High | Total loss of confidentiality: the attacker can read all the data the program can reach. |
| Data changed | High | The attacker can change or delete anything the program can reach. |
| Service disrupted | High | The attacker can take the service down completely. |
| Ease of attack | 1.8 | A score for how easy it is to use the flaw. Higher is easier. |
| Damage | 5.9 | A score for how bad the harm is if it works. Higher is worse. |
NIST lists 8 sources for this flaw, none tagged as a vendor patch.