{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-26654",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-26654"
  ],
  "published": "2024-04-01T08:35:48Z",
  "summary": "ALSA: sh: aica: reorder cleanup operations to avoid UAF bugs",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: sh: aica: reorder cleanup operations to avoid UAF bugs\n\nThe dreamcastcard->timer could schedule the spu_dma_work and the\nspu_dma_work could also arm the dreamcastcard->timer.\n\nWhen the snd_pcm_substream is closing, the aica_channel will be\ndeallocated. But it could still be dereferenced in the worker\nthread. The reason is that del_timer() will return directly\nregardless of whether the timer handler is running or not and\nthe worker could be rescheduled in the timer handler. As a result,\nthe UAF bug will happen. The racy situation is shown below:\n\n      (Thread 1)                 |      (Thread 2)\nsnd_aicapcm_pcm_close()          |\n ...                             |  run_spu_dma() //worker\n                                 |    mod_timer()\n  flush_work()                   |\n  del_timer()                    |  aica_period_elapsed() //timer\n  kfree(dreamcastcard->channel)  |    schedule_work()\n                                 |  run_spu_dma() //worker\n  ...                            |    dreamcastcard->channel-> //USE\n\nIn order to mitigate this bug and other possible corner cases,\ncall mod_timer() conditionally in run_spu_dma(), then implement\nPCM sync_stop op to cancel both the timer and worker. The sync_stop\nop will be called from PCM core appropriately when needed.",
  "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.84",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-26654"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/eeb2a2ca0b8de7e1c66afaf719529154e7dc60b2"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/4206ad65a0ee76920041a755bd3c17c6ba59bba2"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/aa39e6878f61f50892ee2dd9d2176f72020be845"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/8c990221681688da34295d6d76cc2f5b963e83f5"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/9d66ae0e7bb78b54e1e0525456c6b54e1d132046"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/61d4787692c1fccdc268ffa7a891f9c149f50901"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/e955e8a7f38a856fc6534ba4e6bffd4d5cc80ac3"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/3c907bf56905de7d27b329afaf59c2fb35d17b04"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/051e0840ffa8ab25554d6b14b62c9ab9e4901457"
    }
  ],
  "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 only through the ALSA PCM character device `/dev/snd/pcmC0D0p` via open/ioctl(PREPARE,START)/close on the local system. There is no network-facing path into the Dreamcast AICA driver.\nAC:L - The attacker drives both sides of the race \u2014 arming the self-rearming timer/work pair with TRIGGER_START and then closing the substream \u2014 and the timer rearms every jiffy, so the window recurs continuously and a tight open/start/close loop wins it reliably. No condition outside the attacker's control is required.\nPR:L - Only a local unprivileged account with access to the sound device node is needed (audio group or console-user ACL); no capability, CAP_SYS_ADMIN, or root check exists anywhere on the `snd_pcm_release_substream()` \u2192 `snd_aicapcm_pcm_close()` path.\nUI:N - The attacking process performs every step itself \u2014 opening the PCM device, starting playback, and closing it \u2014 with no action from any other user.\nS:U - The use-after-free corrupts kernel slab memory within the same kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - Use-after-free on a kmalloc-32 object: `startup_aica()` reads all 32 bytes of the freed `struct aica_channel` and DMAs them into SPU memory, and the freed slot can be groomed to hold attacker-selected reclaimed kernel objects, giving a path to kernel memory disclosure.\nI:H - `run_spu_dma()` performs `dreamcastcard->channel->flags |= 0x01` on freed memory \u2014 a read-modify-write into a reclaimed kmalloc-32 object the attacker can heap-spray, yielding a controlled write primitive usable for privilege escalation.\nA:H - The revived worker also dereferences `dreamcastcard->substream` after close sets it to NULL, giving a deterministic oops, and the UAF itself corrupts slab state leading to kernel panic."
    }
  }
}
