CVE-2024-49998: net: dsa: improve shutdown sequence

Published Oct 21, 2024
·
Updated

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 devgetdrvdata() at "arbitrary runtime" (not probe, not shutdown, not remove):

phystatemachine() -> ... -> dsauserphyread() -> ds->ops->phyread() -> lan9303phyread() -> chip->ops->phyread() -> lan9303mdiophyread() -> devgetdrvdata()

But we never stop the phystatemachine(), so it may continue to run after dsaswitchshutdown(). 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->dsaptr = NULL; is concurrent with receive packet processing. dsaswitchrcv() checks once whether dev->dsaptr is NULL, but afterwards, rather than continuing to use that non-NULL value, dev->dsaptr is dereferenced again and again without NULL checks: dsaconduitfinduser() 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, devclose(conduit) triggers the NETDEVGOINGDOWN event in dsausernetdeviceevent() which closes user ports as well. dsaportdisablert() calls phylinkstop(), which synchronously stops the phylink state machine, and ds->ops->phyread() will thus no longer call into the driver after this point.

In the second case, devclose(conduit) should do this, as per Documentation/networking/driver.rst:

| Quiescence | ---------- | | After the ndostop 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->dsaptr, there will be no concurrent dsaswitchrcv() call on this conduit.

The addition of the netifdevicedetach() 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 dsaswitchshutdown(). 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->dsaptr (one which doesn't ensure that the interfaces aren't up).

Other sources

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

10 affected componentsFixes available
Linux Linux kernel>=5.15.155<5.16
Linux Linux kernel>=5.16.10<5.17
Linux Linux kernel>=5.17<6.10.14
Linux Linux kernel>=6.11<6.11.3
Linux Linux kernel=6.12-rc1
debian/linux<=6.1.129-1, <=6.1.135-1
5.10.223-15.10.234-16.12.25-16.12.27-1
Microsoft cbl2 kernel 5.15.182.1-1
Microsoft cbl2 kernel 5.15.182.1-1
Microsoft cbl2 kernel 5.15.176.3-1
Microsoft azl3 kernel 6.6.112.1-2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.12.25-1Fixed in 6.12.27-1

Event History

Oct 21, 2024
CVE Published
via MITRE·06:02 PM
Data Sourced
via MITRE·06:02 PM
Description
Data Sourced
via NVD·06:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Feb 20, 2025
Data Sourced
via Launchpad·12:45 AM
Description
Apr 29, 2025
Data Sourced
via Ubuntu·01:00 AM
RemedyDescriptionSeverityAffected Software
Sep 4, 2025
Data Sourced
via Microsoft·04:42 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·04:42 AM
Affected Software
Updated
via Microsoft·04:42 AM
Description
Updated
via Microsoft·04:42 AM
DescriptionSeverity
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-49998?

The severity of CVE-2024-49998 is classified as medium due to potential issues during the shutdown sequence of the lan9303 driver in the Linux kernel.

2

Which Linux kernel versions are affected by CVE-2024-49998?

CVE-2024-49998 affects Linux kernel versions between 5.15.155 and 5.16.10, as well as versions up to 6.11.3 and specific version 6.12-rc1.

3

How do I fix CVE-2024-49998?

To fix CVE-2024-49998, update your Linux kernel to a version that contains the necessary patches after 6.12-rc1.

4

What problems are associated with CVE-2024-49998?

CVE-2024-49998 is associated with shutdown sequence problems in the lan9303 driver, which can lead to system instability.

5

Who discovered CVE-2024-49998?

CVE-2024-49998 was discovered by Alexander Sverdlin.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203