Skip to content
Heist/ feed
Unrated

net: dsa: improve shutdown sequence

Type: advisorySource: Official CVE List1 source record

In the Linux kernel, the following vulnerability has been resolved: net: dsa: improve shutdown sequence Alexander Sverdlin presents 2 problems during shutdown with the lan9303 driver. One is specific to lan9303 and the other just happens to reproduce there. The first problem is that lan9303 is unique among DSA drivers in that it calls dev_get_drvdata() at "arbitrary runtime" (not probe, not shutdown, not remove): phy_state_machine() -> ... -> dsa_user_phy_read() -> ds->ops->phy_read() -> lan9303_phy_read() -> chip->ops->phy_read() -> lan9303_mdio_phy_read() -> dev_get_drvdata() But we never stop the phy_state_machine(), so it may continue to run after dsa_switch_shutdown(). Our common pattern in all DSA drivers is to set drvdata to NULL to suppress the remove() method that may come afterwards. But in this case it will result in an NPD. The second problem is that the way in which we set dp->conduit->dsa_ptr = NULL; is concurrent with receive packet processing. dsa_switch_rcv() checks once whether dev->dsa_ptr is NULL, but afterwards, rather than continuing to use that non-NULL value, dev->dsa_ptr is dereferenced again and again without NULL checks: dsa_conduit_find_user() and many other places. In between dereferences, there is no locking to ensure that what was valid once continues to be valid. Both problems have the common aspect that closing the conduit interface solves them. In the first case, dev_close(conduit) triggers the NETDEV_GOING_DOWN event in dsa_user_netdevice_ev

Announced Source revision 1
Original source ↗

CVE-2024-49998

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: cve:CVE-2024-49998

Linux

Source reference: /containers/cna/affected/0/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Linux

Source reference: /containers/cna/affected/1/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "ff45899e732e57088985e3a497b1d9100571c0f5",
        "lessThan": "87bd909a7014e32790e8c759d5b7694a95778ca5",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "ee534378f00561207656663d93907583958339ae",
        "lessThan": "ab9e90619b6339becc5415647ae154a9a46a044d",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "ee534378f00561207656663d93907583958339ae",
        "lessThan": "2e93bf719462ac6d23c881c8b93e5dc9bf5ab7f5",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "ee534378f00561207656663d93907583958339ae",
        "lessThan": "ab5d3420a1120950703dbdc33698b28a6ebc3d23",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "ee534378f00561207656663d93907583958339ae",
        "lessThan": "b4a65d479213fe84ecb14e328271251eebe69492",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "ee534378f00561207656663d93907583958339ae",
        "lessThan": "6c24a03a61a245fe34d47582898331fa034b6ccd",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "89b60402d43cdab4387dbbf24afebda5cf092ae7",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "5.15.155",
        "lessThan": "5.15.176",
        "versionType": "semver"
      },
      {
        "status": "affected",
        "version": "5.16.10",
        "lessThan": "5.17",
        "versionType": "semver"
      }
    ],
    "programFiles": [
      "net/dsa/dsa.c"
    ],
    "defaultStatus": "unaffected"
  },
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "5.17"
      },
      {
        "status": "unaffected",
        "version": "0",
        "lessThan": "5.17",
        "versionType": "semver"
      },
      {
        "status": "unaffected",
        "version": "5.15.176",
        "versionType": "semver",
        "lessThanOrEqual": "5.15.*"
      },
      {
        "status": "unaffected",
        "version": "6.1.167",
        "versionType": "semver",
        "lessThanOrEqual": "6.1.*"
      },
      {
        "status": "unaffected",
        "version": "6.6.117",
        "versionType": "semver",
        "lessThanOrEqual": "6.6.*"
      },
      {
        "status": "unaffected",
        "version": "6.10.14",
        "versionType": "semver",
        "lessThanOrEqual": "6.10.*"
      },
      {
        "status": "unaffected",
        "version": "6.11.3",
        "versionType": "semver",
        "lessThanOrEqual": "6.11.*"
      },
      {
        "status": "unaffected",
        "version": "6.12",
        "versionType": "original_commit_for_fix",
        "lessThanOrEqual": "*"
      }
    ],
    "programFiles": [
      "net/dsa/dsa.c"
    ],
    "defaultStatus": "affected"
  }
]
Related CVEs
CVE-2024-49998

Source reference: /cveMetadata/cveId

Publisher severity

No explicit severity was provided.

Event
#26767 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement