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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 4.7
- **CVSS:** 4.7 (v3.1, NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.22% (percentile 8, 2026-11-26)
- **CWE:** CWE-367, CWE-476
- **Published:** 2024-10-21T18:02:38.316Z
- **Modified:** 2026-11-10T13:17:24.630Z

## Who should check

- Anyone running Linux \>= ff45899e732e57088985e3a497b1d9100571c0f5, \< 87bd909a7014e32790e8c759d5b7694a95778ca5; \>= ee534378f00561207656663d93907583958339ae, \< ab9e90619b6339becc5415647ae154a9a46a044d; \>= ee534378f00561207656663d93907583958339ae, \< 2e93bf719462ac6d23c881c8b93e5dc9bf5ab7f5; \>= ee534378f00561207656663d93907583958339ae, \< ab5d3420a1120950703dbdc33698b28a6ebc3d23; \>= ee534378f00561207656663d93907583958339ae, \< b4a65d479213fe84ecb14e328271251eebe69492; \>= ee534378f00561207656663d93907583958339ae, \< 6c24a03a61a245fe34d47582898331fa034b6ccd; 89b60402d43cdab4387dbbf24afebda5cf092ae7; \>= 5.15.155, \< 5.15.176; \>= 5.16.10, \< 5.17
- Anyone running Linux 5.17

## Description

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).

## Affected and fixed versions

- Linux: \>= ff45899e732e57088985e3a497b1d9100571c0f5, \< 87bd909a7014e32790e8c759d5b7694a95778ca5; \>= ee534378f00561207656663d93907583958339ae, \< ab9e90619b6339becc5415647ae154a9a46a044d; \>= ee534378f00561207656663d93907583958339ae, \< 2e93bf719462ac6d23c881c8b93e5dc9bf5ab7f5; \>= ee534378f00561207656663d93907583958339ae, \< ab5d3420a1120950703dbdc33698b28a6ebc3d23; \>= ee534378f00561207656663d93907583958339ae, \< b4a65d479213fe84ecb14e328271251eebe69492; \>= ee534378f00561207656663d93907583958339ae, \< 6c24a03a61a245fe34d47582898331fa034b6ccd; 89b60402d43cdab4387dbbf24afebda5cf092ae7; \>= 5.15.155, \< 5.15.176; \>= 5.16.10, \< 5.17 (cvelist)
- Linux: 5.17 (cvelist)

## Mitigation

- Upgrade Linux to 5.17 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-49998. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-49998.md
Affected: Linux >= ff45899e732e57088985e3a497b1d9100571c0f5, < 87bd909a7014e32790e8c759d5b7694a95778ca5; >= ee534378f00561207656663d93907583958339ae, < ab9e90619b6339becc5415647ae154a9a46a044d; >= ee534378f00561207656663d93907583958339ae, < 2e93bf719462ac6d23c881c8b93e5dc9bf5ab7f5; >= ee534378f00561207656663…
Fixed in: Linux 87bd909a7014e32790e8c759d5b7694a95778ca5, Linux 2e93bf719462ac6d23c881c8b93e5dc9bf5ab7f5, Linux 6c24a03a61a245fe34d47582898331fa034b6ccd, Linux 5.15.176, Linux 5.17

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-49998 being exploited?

There is no confirmed exploitation: CVE-2024-49998 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.22% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-49998?

Medium: CVSS 4.7 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2024-49998?

Linux \>= ff45899e732e57088985e3a497b1d9100571c0f5, \< 87bd909a7014e32790e8c759d5b7694a95778ca5; \>= ee534378f00561207656663d93907583958339ae, \< ab9e90619b6339becc5415647ae154a9a46a044d; \>= ee534378f00561207656663d93907583958339ae, \< 2e93bf719462ac6d23c881c8b93e5dc9bf5ab7f5; \>= ee534378f00561207656663d93907583958339ae, \< ab5d3420a1120950703dbdc33698b28a6ebc3d23; \>= ee534378f00561207656663d93907583958339ae, \< b4a65d479213fe84ecb14e328271251eebe69492; \>= ee534378f00561207656663d93907583958339ae, \< 6c24a03a61a245fe34d47582898331fa034b6ccd; 89b60402d43cdab4387dbbf24afebda5cf092ae7; \>= 5.15.155, \< 5.15.176; \>= 5.16.10, \< 5.17; Linux 5.17.

### Is there a fix for CVE-2024-49998?

Yes. Fixed in Linux 87bd909a7014e32790e8c759d5b7694a95778ca5, Linux 2e93bf719462ac6d23c881c8b93e5dc9bf5ab7f5, Linux 6c24a03a61a245fe34d47582898331fa034b6ccd, Linux 5.15.176, Linux 5.17. Upgrade Linux to 5.17 or later.

### How do I check if I'm affected by CVE-2024-49998?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/ab5d3420a1120950703dbdc33698b28a6ebc3d23>
- patch: <https://git.kernel.org/stable/c/b4a65d479213fe84ecb14e328271251eebe69492>
- patch: <https://git.kernel.org/stable/c/6c24a03a61a245fe34d47582898331fa034b6ccd>
- other: <https://git.kernel.org/stable/c/87bd909a7014e32790e8c759d5b7694a95778ca5>
- other: <https://git.kernel.org/stable/c/ab9e90619b6339becc5415647ae154a9a46a044d>
- other: <https://git.kernel.org/stable/c/2e93bf719462ac6d23c881c8b93e5dc9bf5ab7f5>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-082556.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-019113.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-457936.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-784472.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-49998>

HTML: <https://flawdb.com/CVE-2024-49998> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-49998>
