CVE-2022-49292
JSON

7.8high

ALSA: oss: Fix PCM OSS buffer allocation overflow

Severity
7.8high CVSS:3.1 by Linux
Exploit likelihood
0.28% (higher than 22% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: ALSA: oss: Fix PCM OSS buffer allocation overflow We've got syzbot reports hitting INT_MAX overflow at vmalloc() allocation that is called from snd_pcm_plug_alloc(). Although we apply the restrictions to input parameters, it's based only on the hw_params of the underlying PCM device. Since the PCM OSS layer allocates a temporary buffer for the data conversion, the size may become unexpectedly large when more channels or higher rates is given; in the reported case, it went over INT_MAX, hence it hits WARN_ON(). This patch is an attempt to avoid such an overflow and an allocation for too large buffers. First off, it adds the limit of 1MB as the upper bound for period bytes. This must be large enough for all use cases, and we really don't want to handle a larger temporary buffer than this size. The size check is performed at two places, where the original period bytes is calculated and where the plugin buffer size is calculated. In addition, the driver uses array_size() and array3_size() for multiplications to catch overflows for the converted period size and buffer bytes.

Affected

Product or packageVersionsReported by
Linux Linuxfrom 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before a63af1baf0a5e11827db60e3127f87e437cab6e5, from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 0c4190b41a69990666b4000999e27f8f1b2a426b, from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 5ce74ff7059341d8b2f4d01c3383491df63d1898, from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 7a40cbf3579a8e14849ba7ce46309c1992658d2b, from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before fb08bf99195a87c798bc8ae1357337a981faeade, from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before e74a069c6a7bb505f3ade141dddf85f4b0b5145a, from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before efb6402c3c4a7c26d97c92d70186424097b6e366, 2.6.12
Not affected: before 2.6.12, from 4.19.237 up to 4.19.*, from 5.4.188 up to 5.4.*, from 5.10.109 up to 5.10.*, from 5.15.32 up to 5.15.*, from 5.16.18 up to 5.16.*
CVE List
linux linux_kernelbefore 4.19.237, from 4.20 before 5.4.188, from 5.5 before 5.10.109, from 5.11 before 5.15.32, from 5.16 before 5.16.18, 5.17NVD

All scores

Linux7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Classification

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: ALSA: oss: Fix PCM OSS buffer allocation overflow We've got syzbot reports hitting INT_MAX overflow at vmalloc() allocation that is called from snd_pcm_plug_alloc(). Although we apply the restrictions to input parameters, it's based only on the hw_params of the underlying PCM device. Since the PCM OSS layer allocates a temporary buffer for the data conversion, the size may become unexpectedly large when more channels or higher rates is given; in the reported case, it went over INT_MAX, hence it hits WARN_ON(). This patch is an attempt to avoid such an overflow and an allocation for too large buffers. First off, it adds the limit of 1MB as the upper bound for period bytes. This must be large enough for all use cases, and we really don't want to handle a larger temporary buffer than this size. The size check is performed at two places, where the original period bytes is calculated and where the plugin buffer size is calculated. In addition, the driver uses array_size() and array3_size() for multiplications to catch overflows for the converted period size and buffer bytes.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ALSA: oss: Fix PCM OSS buffer assignment overflow Tenemos informes de syzbot que alcanzan un desbordamiento de INT_MAX en la asignación de vmalloc() que se llama desde snd_pcm_plug_alloc(). Aunque aplicamos las restricciones a los parámetros de entrada, se basa solo en hw_params del dispositivo PCM subyacente. Dado que la capa PCM OSS asigna un búfer temporal para la conversión de datos, el tamaño puede volverse inesperadamente grande cuando se dan más canales o velocidades más altas; en el caso informado, superó INT_MAX, por lo tanto, alcanza WARN_ON(). Este parche es un intento de evitar dicho desbordamiento y una asignación para búferes demasiado grandes. En primer lugar, agrega el límite de 1 MB como límite superior para bytes de período. Esto debe ser lo suficientemente grande para todos los casos de uso, y realmente no queremos manejar un búfer temporal más grande que este tamaño. La comprobación del tamaño se realiza en dos lugares: donde se calculan los bytes del período original y donde se calcula el tamaño del búfer del complemento. Además, el controlador utiliza array_size() y array3_size() para las multiplicaciones con el fin de detectar desbordamientos en el tamaño del período convertido y los bytes del búfer.

References

Sources

SourceRecordLicence
CVE ListCVE-2022-49292 changed 2026-08-05CVE Terms of Use
NVDCVE-2022-49292 changed 2026-08-04Public domain