CVE-2023-53854 (GCVE-0-2023-53854)

Vulnerability from cvelistv5 – Published: 2025-12-09 01:30 – Updated: 2026-05-11 19:52
VLAI
Title
ASoC: mediatek: mt8186: Fix use-after-free in driver remove path
Summary
In the Linux kernel, the following vulnerability has been resolved: ASoC: mediatek: mt8186: Fix use-after-free in driver remove path When devm runs function in the "remove" path for a device it runs them in the reverse order. That means that if you have parts of your driver that aren't using devm or are using "roll your own" devm w/ devm_add_action_or_reset() you need to keep that in mind. The mt8186 audio driver didn't quite get this right. Specifically, in mt8186_init_clock() it called mt8186_audsys_clk_register() and then went on to call a bunch of other devm function. The caller of mt8186_init_clock() used devm_add_action_or_reset() to call mt8186_deinit_clock() but, because of the intervening devm functions, the order was wrong. Specifically at probe time, the order was: 1. mt8186_audsys_clk_register() 2. afe_priv->clk = devm_kcalloc(...) 3. afe_priv->clk[i] = devm_clk_get(...) At remove time, the order (which should have been 3, 2, 1) was: 1. mt8186_audsys_clk_unregister() 3. Free all of afe_priv->clk[i] 2. Free afe_priv->clk The above seemed to be causing a use-after-free. Luckily, it's easy to fix this by simply using devm more correctly. Let's move the devm_add_action_or_reset() to the right place. In addition to fixing the use-after-free, code inspection shows that this fixes a leak (missing call to mt8186_audsys_clk_unregister()) that would have happened if any of the syscon_regmap_lookup_by_phandle() calls in mt8186_init_clock() had failed.
Severity
No CVSS data available.
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: 55b423d5623ccd6785429431c2cf5f3e073b73ba , < 3e56a1c04882852e3e7d6c59756a16211ebbc457 (git)
Affected: 55b423d5623ccd6785429431c2cf5f3e073b73ba , < dffd9e2b57cb845930fa885aa634a847ba2130dd (git)
Affected: 55b423d5623ccd6785429431c2cf5f3e073b73ba , < a93d2afd3f77a7331271a0f25c6a11003db69b3c (git)
guessed Create a notification for this product.
Linux Linux Affected: 6.0
Unaffected: 0 , < 6.0 (semver)
Unaffected: 6.1.30 , ≤ 6.1.* (semver)
Unaffected: 6.3.4 , ≤ 6.3.* (semver)
Unaffected: 6.4 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "sound/soc/mediatek/mt8186/mt8186-afe-clk.c",
            "sound/soc/mediatek/mt8186/mt8186-afe-clk.h",
            "sound/soc/mediatek/mt8186/mt8186-afe-pcm.c",
            "sound/soc/mediatek/mt8186/mt8186-audsys-clk.c",
            "sound/soc/mediatek/mt8186/mt8186-audsys-clk.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "3e56a1c04882852e3e7d6c59756a16211ebbc457",
              "status": "affected",
              "version": "55b423d5623ccd6785429431c2cf5f3e073b73ba",
              "versionType": "git"
            },
            {
              "lessThan": "dffd9e2b57cb845930fa885aa634a847ba2130dd",
              "status": "affected",
              "version": "55b423d5623ccd6785429431c2cf5f3e073b73ba",
              "versionType": "git"
            },
            {
              "lessThan": "a93d2afd3f77a7331271a0f25c6a11003db69b3c",
              "status": "affected",
              "version": "55b423d5623ccd6785429431c2cf5f3e073b73ba",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "sound/soc/mediatek/mt8186/mt8186-afe-clk.c",
            "sound/soc/mediatek/mt8186/mt8186-afe-clk.h",
            "sound/soc/mediatek/mt8186/mt8186-afe-pcm.c",
            "sound/soc/mediatek/mt8186/mt8186-audsys-clk.c",
            "sound/soc/mediatek/mt8186/mt8186-audsys-clk.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.0"
            },
            {
              "lessThan": "6.0",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.30",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.3.*",
              "status": "unaffected",
              "version": "6.3.4",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.4",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.30",
                  "versionStartIncluding": "6.0",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.3.4",
                  "versionStartIncluding": "6.0",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.4",
                  "versionStartIncluding": "6.0",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nASoC: mediatek: mt8186: Fix use-after-free in driver remove path\n\nWhen devm runs function in the \"remove\" path for a device it runs them\nin the reverse order. That means that if you have parts of your driver\nthat aren\u0027t using devm or are using \"roll your own\" devm w/\ndevm_add_action_or_reset() you need to keep that in mind.\n\nThe mt8186 audio driver didn\u0027t quite get this right. Specifically, in\nmt8186_init_clock() it called mt8186_audsys_clk_register() and then\nwent on to call a bunch of other devm function. The caller of\nmt8186_init_clock() used devm_add_action_or_reset() to call\nmt8186_deinit_clock() but, because of the intervening devm functions,\nthe order was wrong.\n\nSpecifically at probe time, the order was:\n1. mt8186_audsys_clk_register()\n2. afe_priv-\u003eclk = devm_kcalloc(...)\n3. afe_priv-\u003eclk[i] = devm_clk_get(...)\n\nAt remove time, the order (which should have been 3, 2, 1) was:\n1. mt8186_audsys_clk_unregister()\n3. Free all of afe_priv-\u003eclk[i]\n2. Free afe_priv-\u003eclk\n\nThe above seemed to be causing a use-after-free. Luckily, it\u0027s easy to\nfix this by simply using devm more correctly. Let\u0027s move the\ndevm_add_action_or_reset() to the right place. In addition to fixing\nthe use-after-free, code inspection shows that this fixes a leak\n(missing call to mt8186_audsys_clk_unregister()) that would have\nhappened if any of the syscon_regmap_lookup_by_phandle() calls in\nmt8186_init_clock() had failed."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-05-11T19:52:48.131Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/3e56a1c04882852e3e7d6c59756a16211ebbc457"
        },
        {
          "url": "https://git.kernel.org/stable/c/dffd9e2b57cb845930fa885aa634a847ba2130dd"
        },
        {
          "url": "https://git.kernel.org/stable/c/a93d2afd3f77a7331271a0f25c6a11003db69b3c"
        }
      ],
      "title": "ASoC: mediatek: mt8186: Fix use-after-free in driver remove path",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2023-53854",
    "datePublished": "2025-12-09T01:30:19.746Z",
    "dateReserved": "2025-12-09T01:27:17.828Z",
    "dateUpdated": "2026-05-11T19:52:48.131Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2023-53854",
      "date": "2026-09-28",
      "epss": "0.00219",
      "percentile": "0.11089"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "defaultStatus": "unaffected",
                "product": "Linux",
                "programFiles": [
                  "sound/soc/mediatek/mt8186/mt8186-afe-clk.c",
                  "sound/soc/mediatek/mt8186/mt8186-afe-clk.h",
                  "sound/soc/mediatek/mt8186/mt8186-afe-pcm.c",
                  "sound/soc/mediatek/mt8186/mt8186-audsys-clk.c",
                  "sound/soc/mediatek/mt8186/mt8186-audsys-clk.h"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "lessThan": "3e56a1c04882852e3e7d6c59756a16211ebbc457",
                    "status": "affected",
                    "version": "55b423d5623ccd6785429431c2cf5f3e073b73ba",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "dffd9e2b57cb845930fa885aa634a847ba2130dd",
                    "status": "affected",
                    "version": "55b423d5623ccd6785429431c2cf5f3e073b73ba",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "a93d2afd3f77a7331271a0f25c6a11003db69b3c",
                    "status": "affected",
                    "version": "55b423d5623ccd6785429431c2cf5f3e073b73ba",
                    "versionType": "git"
                  }
                ]
              },
              {
                "defaultStatus": "affected",
                "product": "Linux",
                "programFiles": [
                  "sound/soc/mediatek/mt8186/mt8186-afe-clk.c",
                  "sound/soc/mediatek/mt8186/mt8186-afe-clk.h",
                  "sound/soc/mediatek/mt8186/mt8186-afe-pcm.c",
                  "sound/soc/mediatek/mt8186/mt8186-audsys-clk.c",
                  "sound/soc/mediatek/mt8186/mt8186-audsys-clk.h"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "status": "affected",
                    "version": "6.0"
                  },
                  {
                    "lessThan": "6.0",
                    "status": "unaffected",
                    "version": "0",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.1.*",
                    "status": "unaffected",
                    "version": "6.1.30",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.3.*",
                    "status": "unaffected",
                    "version": "6.3.4",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "*",
                    "status": "unaffected",
                    "version": "6.4",
                    "versionType": "original_commit_for_fix"
                  }
                ]
              }
            ],
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nASoC: mediatek: mt8186: Fix use-after-free in driver remove path\n\nWhen devm runs function in the \"remove\" path for a device it runs them\nin the reverse order. That means that if you have parts of your driver\nthat aren\u0027t using devm or are using \"roll your own\" devm w/\ndevm_add_action_or_reset() you need to keep that in mind.\n\nThe mt8186 audio driver didn\u0027t quite get this right. Specifically, in\nmt8186_init_clock() it called mt8186_audsys_clk_register() and then\nwent on to call a bunch of other devm function. The caller of\nmt8186_init_clock() used devm_add_action_or_reset() to call\nmt8186_deinit_clock() but, because of the intervening devm functions,\nthe order was wrong.\n\nSpecifically at probe time, the order was:\n1. mt8186_audsys_clk_register()\n2. afe_priv-\u003eclk = devm_kcalloc(...)\n3. afe_priv-\u003eclk[i] = devm_clk_get(...)\n\nAt remove time, the order (which should have been 3, 2, 1) was:\n1. mt8186_audsys_clk_unregister()\n3. Free all of afe_priv-\u003eclk[i]\n2. Free afe_priv-\u003eclk\n\nThe above seemed to be causing a use-after-free. Luckily, it\u0027s easy to\nfix this by simply using devm more correctly. Let\u0027s move the\ndevm_add_action_or_reset() to the right place. In addition to fixing\nthe use-after-free, code inspection shows that this fixes a leak\n(missing call to mt8186_audsys_clk_unregister()) that would have\nhappened if any of the syscon_regmap_lookup_by_phandle() calls in\nmt8186_init_clock() had failed."
          }
        ],
        "id": "CVE-2023-53854",
        "lastModified": "2026-06-17T06:46:11.367",
        "metrics": {},
        "published": "2025-12-09T16:17:26.060",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/3e56a1c04882852e3e7d6c59756a16211ebbc457"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/a93d2afd3f77a7331271a0f25c6a11003db69b3c"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/dffd9e2b57cb845930fa885aa634a847ba2130dd"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Deferred"
      }
    },
    "redhat_vex": {
      "aggregate_severity": "None",
      "current_release_date": "2026-06-30T10:29:25+00:00",
      "cve": "CVE-2023-53854",
      "id": "CVE-2023-53854",
      "initial_release_date": "2023-01-01T00:00:00+00:00",
      "product_status:known_not_affected": "274",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: ASoC: mediatek: mt8186: Fix use-after-free in driver remove path",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2023/cve-2023-53854.json",
      "version": "3"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-08-31T00:55:14Z",
      "cve": "CVE-2023-53854",
      "id": "CVE-2023-53854",
      "initial_release_date": "2025-12-10T00:34:33Z",
      "product_status:known_not_affected": "515",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2023-53854",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2023-53854.json",
      "version": "10"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…