CVE-2024-49998

Medium

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_event() which closes user ports as well. dsa_port_disable_rt() calls phylink_stop(), which synchronously stops the phylink state machine, and ds->ops->phy_read() will thus no longer call into the driver after this point. In the second case, dev_close(conduit) should do this, as per Documentation/networking/driver.rst: | Quiescence | ---------- | | After the ndo_stop routine has been called, the hardware must | not receive or transmit any data. All in flight packets must | be aborted. If necessary, poll or wait for completion of | any reset commands. So it should be sufficient to ensure that later, when we zeroize conduit->dsa_ptr, there will be no concurrent dsa_switch_rcv() call on this conduit. The addition of the netif_device_detach() function is to ensure that ioctls, rtnetlinks and ethtool requests on the user ports no longer propagate down to the driver - we're no longer prepared to handle them. The race condition actually did not exist when commit 0650bf52b31f ("net: dsa: be compatible with masters which unregister on shutdown") first introduced dsa_switch_shutdown(). It was created later, when we stopped unregistering the user interfaces from a bad spot, and we just replaced that sequence with a racy zeroization of conduit->dsa_ptr (one which doesn't ensure that the interfaces aren't up).

Package Linux Kernel
Published 2024-10-21
Last modified 2026-03-25
CVSS version 3.1
Patch available
Yes

CVSS 3.1 score

4.7

out of 10
Medium
Attack Vector
Local
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
High
Vector string
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H

Weakness type

CWE-367

CVE-2024-49998 is classified as CWE-367

See CWE-367 on MITRE CWE for full details on this weakness type.

Affected versions

Linux kernel versions 5.15.155, 5.16.10, 5.17 and later are affected. Fixed in 5.15.176, 6.1.167, 6.6.117, 6.10.14, 6.11.3, 6.12 and their respective stable series.

Affected from
≥ 5.15.155 ≥ 5.16.10 ≥ 5.17
Fixed in
✓ 5.15.176 5.15.x ✓ 6.1.167 6.1.x ✓ 6.6.117 6.6.x ✓ 6.10.14 6.10.x ✓ 6.11.3 6.11.x ✓ 6.12

References

The following references provide additional information about CVE-2024-49998 including vendor advisories, patch commits, exploit details, and third-party analysis. Links are sourced from the NIST NVD database.

Frequently asked questions

  • What is CVE-2024-49998?

    CVE-2024-49998 is a Medium severity Linux kernel vulnerability with a CVSS score of 4.7 out of 10 . It affects Linux kernel versions from 5.15.155 onward and has been patched in 5.15.176, 6.1.167, 6.6.117 and others. CVE-2024-49998 has not been confirmed as actively exploited and is not listed in the CISA KEV catalog.

  • What is the CVSS score for CVE-2024-49998?

    CVE-2024-49998 has a CVSS score of 4.7 out of 10, rated Medium severity (CVSS 3.1). The vector string is CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H .

  • Is there a patch available for CVE-2024-49998?

    Yes — CVE-2024-49998 has been patched. Fixed versions include 5.15.176, 6.1.167, 6.6.117 and others. If you are running Linux kernel 5.15.155 or later up to the fix versions, apply the relevant patch for your kernel branch.

  • Is CVE-2024-49998 actively exploited?

    No — CVE-2024-49998 has not been confirmed as actively exploited. It is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.