{"id":"CVE-2026-74640","aliases":["CVE-2026-74640"],"related":[],"kind":"vulnerability","state":"published","title":"ALSA: FCP: fix OOB write in fcp_meter_ctl_get()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: FCP: fix OOB write in fcp_meter_ctl_get()\n\nfcp_ioctl_set_meter_map() bounds the user-supplied Level Meter map size\nby the driver's own limit of 255\n\n\tif (map.map_size < 1 || map.map_size > 255 ||\n\t    map.meter_slots < 1 || map.meter_slots > 255)\n\t\treturn -EINVAL;\n\nand passes it to fcp_add_new_ctl() as the control's channel count, where\nit is stored as elem->channels.\n\nEvery control read writes into struct snd_ctl_elem_value, whose integer\narray is declared long value[128], so the limit is 128, not 255.\nfcp_meter_ctl_get() stores one 64-bit word per channel into that array\nwith no bound of its own:\n\n\tfor (i = 0; i < elem->channels; i++) {\n\t\tint idx = private->meter_level_map[i];\n\t\tint value = idx < 0 ? 0 : le32_to_cpu(resp[idx]);\n\n\t\tucontrol->value.integer.value[i] = value;\n\t}\n\nsnd_ctl_elem_read_user() serves that object from\nmemdup_user(_control, sizeof(*control)), 1224 bytes on LP64 out of\nkmalloc-2048.  offsetof(struct snd_ctl_elem_value, value) is 72, so\nelement i is written at byte 72 + 8 * i and element 144 already lands\npast the allocation.  At map_size 255 the last store ends at byte 2112,\n888 bytes past the object and 64 bytes into the adjacent slab object.\nThe stored words come from the device and meter_level_map[] selects\nwhich word lands in which slot, so extent and contents are both\ncontrolled.\n\nThe core does not catch this.  snd_ctl_check_elem_info() is reached only\nfrom __snd_ctl_elem_info(), which snd_ctl_elem_read() calls under\nCONFIG_SND_CTL_DEBUG; without that option snd_ctl_skip_validation() is a\ncompile-time true.  __snd_ctl_add_replace() validates kcontrol->count and\nnever inspects elem->channels.\n\nInstalling an oversized map needs CAP_SYS_RAWIO, but the control outlives\nthe hwdep descriptor that created it, so the out-of-bounds stores are\nissued by any process able to read controls on /dev/snd/controlC0.\n\nKASAN on 7.2.0-rc5 (arm64), triggered by an unprivileged control read:\n\n  BUG: KASAN: slab-out-of-bounds in fcp_meter_ctl_get\n  Write of size 8 at addr ffff000017af04c8 by task fcp_trigger/185\n   __asan_store8\n   fcp_meter_ctl_get\n   snd_ctl_elem_read\n   snd_ctl_ioctl\n  Allocated by task 185:\n   memdup_user\n   snd_ctl_ioctl\n  The buggy address is located 0 bytes to the right of\n   allocated 1224-byte region [ffff000017af0000, ffff000017af04c8)\n\nBound the map size by the ABI limit rather than by 255, and bound the\nstore loop at the sink so it cannot run past the value array whatever\nelem->channels holds.\n\nDiscovered by XBOW, triaged by Baul Lee <baul.lee@xbow.com>","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: FCP: fix OOB write in fcp_meter_ctl_get()\n\nfcp_ioctl_set_meter_map() bounds the user-supplied Level Meter map size\nby the driver's own limit of 255\n\n\tif (map.map_size < 1 || map.map_size > 255 ||\n\t    map.meter_slots < 1 || map.meter_slots > 255)\n\t\treturn -EINVAL;\n\nand passes it to fcp_add_new_ctl() as the control's channel count, where\nit is stored as elem->channels.\n\nEvery control read writes into struct snd_ctl_elem_value, whose integer\narray is declared long value[128], so the limit is 128, not 255.\nfcp_meter_ctl_get() stores one 64-bit word per channel into that array\nwith no bound of its own:\n\n\tfor (i = 0; i < elem->channels; i++) {\n\t\tint idx = private->meter_level_map[i];\n\t\tint value = idx < 0 ? 0 : le32_to_cpu(resp[idx]);\n\n\t\tucontrol->value.integer.value[i] = value;\n\t}\n\nsnd_ctl_elem_read_user() serves that object from\nmemdup_user(_control, sizeof(*control)), 1224 bytes on LP64 out of\nkmalloc-2048.  offsetof(struct snd_ctl_elem_value, value) is 72, so\nelement i is written at byte 72 + 8 * i and element 144 already lands\npast the allocation.  At map_size 255 the last store ends at byte 2112,\n888 bytes past the object and 64 bytes into the adjacent slab object.\nThe stored words come from the device and meter_level_map[] selects\nwhich word lands in which slot, so extent and contents are both\ncontrolled.\n\nThe core does not catch this.  snd_ctl_check_elem_info() is reached only\nfrom __snd_ctl_elem_info(), which snd_ctl_elem_read() calls under\nCONFIG_SND_CTL_DEBUG; without that option snd_ctl_skip_validation() is a\ncompile-time true.  __snd_ctl_add_replace() validates kcontrol->count and\nnever inspects elem->channels.\n\nInstalling an oversized map needs CAP_SYS_RAWIO, but the control outlives\nthe hwdep descriptor that created it, so the out-of-bounds stores are\nissued by any process able to read controls on /dev/snd/controlC0.\n\nKASAN on 7.2.0-rc5 (arm64), triggered by an unprivileged control read:\n\n  BUG: KASAN: slab-out-of-bounds in fcp_meter_ctl_get\n  Write of size 8 at addr ffff000017af04c8 by task fcp_trigger/185\n   __asan_store8\n   fcp_meter_ctl_get\n   snd_ctl_elem_read\n   snd_ctl_ioctl\n  Allocated by task 185:\n   memdup_user\n   snd_ctl_ioctl\n  The buggy address is located 0 bytes to the right of\n   allocated 1224-byte region [ffff000017af0000, ffff000017af04c8)\n\nBound the map size by the ABI limit rather than by 255, and bound the\nstore loop at the sink so it cannot run past the value array whatever\nelem->channels holds.\n\nDiscovered by XBOW, triaged by Baul Lee <baul.lee@xbow.com>","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nALSA: FCP: corrección de escritura fuera de límites en fcp_meter_ctl_get()\n\nfcp_ioctl_set_meter_map() limita el tamaño del mapa del medidor de nivel proporcionado por el usuario por el propio límite del controlador de 255\n\n\tif (map.map_size < 1 || map.map_size > 255 ||\n\t    map.meter_slots < 1 || map.meter_slots > 255)\n\t\treturn -EINVAL;\n\ny lo pasa a fcp_add_new_ctl() como el recuento de canales del control, donde se almacena como elem -> channels.\n\nCada lectura de control escribe en struct snd_ctl_elem_value, cuyo array de enteros se declara long value[128], por lo que el límite es 128, no 255.\nfcp_meter_ctl_get() almacena una palabra de 64 bits por canal en ese array sin un límite propio:\n\n\tfor (i = 0; i < elem -> channels; i++) {\n\t\tint idx = private -> meter_level_map[i];\n\t\tint value = idx < 0 ? 0 : le32_to_cpu(resp[idx]);\n\n\t\tucontrol -> value.integer.value[i] = value;\n\t}\n\nsnd_ctl_elem_read_user() sirve ese objeto desde memdup_user(_control, sizeof(control)), 1224 bytes en LP64 de kmalloc-2048. offsetof(struct snd_ctl_elem_value, value) es 72, por lo que el elemento i se escribe en el byte 72 + 8 * i y el elemento 144 ya cae más allá de la asignación. Con map_size 255, el último almacenamiento termina en el byte 2112, 888 bytes más allá del objeto y 64 bytes dentro del objeto slab adyacente. Las palabras almacenadas provienen del dispositivo y meter_level_map[] selecciona qué palabra cae en qué ranura, por lo que tanto la extensión como el contenido están controlados.\n\nEl núcleo no detecta esto. snd_ctl_check_elem_info() solo se alcanza desde __snd_ctl_elem_info(), que snd_ctl_elem_read() llama bajo CONFIG_SND_CTL_DEBUG; sin esa opción, snd_ctl_skip_validation() es un verdadero en tiempo de compilación. __snd_ctl_add_replace() valida kcontrol -> count y nunca inspecciona elem -> channels.\n\nInstalar un mapa de tamaño excesivo requiere CAP_SYS_RAWIO, pero el control sobrevive al descriptor hwdep que lo creó, por lo que los almacenamientos fuera de límites son emitidos por cualquier proceso capaz de leer controles en /dev/snd/controlC0.\n\nKASAN en 7.2.0-rc5 (arm64), activado por una lectura de control sin privilegios:\n\n  BUG: KASAN: slab-out-of-bounds en fcp_meter_ctl_get\n  Escritura de tamaño 8 en la dirección ffff000017af04c8 por la tarea fcp_trigger/185\n   __asan_store8\n   fcp_meter_ctl_get\n   snd_ctl_elem_read\n   snd_ctl_ioctl\n  Asignado por la tarea 185:\n   memdup_user\n   snd_ctl_ioctl\n  La dirección errónea se encuentra 0 bytes a la derecha de\n   región asignada de 1224 bytes [ffff000017af0000, ffff000017af04c8)\n\nLimitar el tamaño del mapa por el límite ABI en lugar de por 255, y limitar el bucle de almacenamiento en el sumidero para que no pueda ir más allá del array de valores, independientemente de lo que contenga elem -> channels.\n\nDescubierto por XBOW, clasificado por Baul Lee <baul.lee@xbow.com>","source":"nvd"}],"published":"2026-08-22T15:32:18.957Z","modified":"2026-10-16T20:17:48.987Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"46757a3e7d50dac923888e7fbe68377736f13c70","fixed":"bb30e35c36ed00f24fa39aded811f64230a913b0","status":"affected"},{"type":"git","introduced":"46757a3e7d50dac923888e7fbe68377736f13c70","fixed":"bb61dc2ae59026f76db26e1909746908bc5b6f31","status":"affected"},{"type":"git","introduced":"46757a3e7d50dac923888e7fbe68377736f13c70","fixed":"620f1e52a46f604635efd0fb78138afd6a513b5d","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.14","status":"unaffected"},{"type":"semver","introduced":"6.18.45","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.1.9","lastAffected":"7.1.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.2","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/bb30e35c36ed00f24fa39aded811f64230a913b0","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bb61dc2ae59026f76db26e1909746908bc5b6f31","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/620f1e52a46f604635efd0fb78138afd6a513b5d","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-16T19:03:29.066Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-74640","url":"https://www.cve.org/CVERecord?id=CVE-2026-74640","licence":"CVE Terms of Use","modified":"2026-10-16T19:06:04.418Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-74640","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-74640","licence":"Public domain","modified":"2026-10-16T20:17:48.987Z"}],"updatedAt":"2026-11-25T22:59:34.912Z","epss":{"score":0.00127,"percentile":0.02586,"date":"2026-12-01T12:00:22.000Z"}}