{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-38388",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-38388"
  ],
  "published": "2024-06-21T10:24:08Z",
  "summary": "ALSA: hda/cs_dsp_ctl: Use private_free for control cleanup",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: hda/cs_dsp_ctl: Use private_free for control cleanup\n\nUse the control private_free callback to free the associated data\nblock. This ensures that the memory won't leak, whatever way the\ncontrol gets destroyed.\n\nThe original implementation didn't actually remove the ALSA\ncontrols in hda_cs_dsp_control_remove(). It only freed the internal\ntracking structure. This meant it was possible to remove/unload the\namp driver while leaving its ALSA controls still present in the\nsoundcard. Obviously attempting to access them could cause segfaults\nor at least dereferencing stale pointers.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.93",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-38388"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/191dc1b2ff0fb35e7aff15a53224837637df8bff"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/6e359be4975006ff72818e79dad8fe48293f2eb2"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/3291486af5636540980ea55bae985f3eaa5b0740"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/172811e3a557d8681a5e2d0f871dc04a2d17eb13"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:52:36Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The vulnerable code is reached through ioctls (SNDRV_CTL_IOCTL_ELEM_READ/WRITE/INFO) on the local ALSA control device /dev/snd/controlC*, requiring local system access. There is no network-facing component in sound/pci/hda/hda_cs_dsp_ctl.c.\nAC:L - Once the amp driver is unbound the dangling kcontrol persists indefinitely on the sound card, so there is no race to win \u2014 the attacker freely grooms the kmalloc-32/kmalloc-192 slabs to reclaim the freed hda_cs_dsp_coeff_ctl and cs_dsp_coeff_ctl, then triggers the dereference at a time of their choosing, repeatably. Cirrus CS35L41/CS35L56 amps are present on a very large population of current laptops, so the affected configuration is common rather than exotic.\nPR:L - Exploitation only requires the ability to open /dev/snd/controlC* and issue element read/write ioctls, which snd_ctl_elem_read()/snd_ctl_elem_write() perform with no capability check \u2014 any local user in the audio group or with an active logind session qualifies. No root or CAP_SYS_ADMIN is needed to reach the use-after-free.\nUI:N - The attacker performs the entire exploit themselves with ioctls on the stale control; no victim needs to open a file, mount a filesystem, or otherwise interact. The driver-unbind that leaves the stale control behind is an ambient system state (module update, driver reload, codec rebind), not an action the attacker must social-engineer a victim into performing during the attack.\nS:U - The use-after-free corrupts kernel heap memory within the same kernel security authority; there is no VM, IOMMU, or sandbox boundary crossed. Standard kernel-local privilege escalation keeps the scope unchanged.\nC:H - After reclaiming the freed cs_dsp_coeff_ctl the attacker controls ctl->cache and ctl->len, and cs_dsp_coeff_read_ctrl() does memcpy(buf, ctl->cache + off*4, len) into the control value buffer, which snd_ctl_ioctl_elem_read() copies straight to userspace \u2014 an arbitrary kernel memory read primitive.\nI:H - cs_dsp_coeff_write_ctrl() does memcpy(ctl->cache + off*4, buf, len) with an attacker-controlled destination pointer and attacker-supplied data, giving an arbitrary kernel write; additionally the stale kcontrol's get/put/info function pointers reference the unloaded snd-hda-cs-dsp-ctls module text, allowing indirect control-flow hijack into freed executable memory.\nA:H - Even without successful heap grooming, dereferencing the freed hda_cs_dsp_coeff_ctl and cs_dsp_coeff_ctl, taking a mutex on freed memory, and calling into unloaded module text reliably produces an oops or panic. Any unprivileged user with audio access can crash the machine on demand."
    }
  }
}
