CVE-2024-54680: smb: client: fix TCP timers deadlock after rmmod

Published Jan 11, 2025
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

smb: client: fix TCP timers deadlock after rmmod

Commit ef7134c7fc48 ("smb: client: Fix use-after-free of network namespace.") fixed a netns UAF by manually enabled socket refcounting (sk->sknetrefcnt=1 and sockinuseadd(net, 1)).

The reason the patch worked for that bug was because we now hold references to the netns (getnettrack() gets a ref internally) and they're properly released (internally, on skdestruct()), but only because sk->sknetrefcnt was set.

Problem: (this happens regardless of CONFIGNETNSREFCNTTRACKER and regardless if initnet or other)

Setting sk->sknetrefcnt=1 manually and after socket creation is not only out of cifs scope, but also technically wrong -- it's set conditionally based on user (=1) vs kernel (=0) sockets. And net/ implementations seem to base their user vs kernel space operations on it.

e.g. upon TCP socket close, the TCP timers are not cleared because sk->sknetrefcnt=1: (cf. commit 151c9c724d05 ("tcp: properly terminate timers for kernel sockets"))

net/ipv4/tcp.c: void tcpclose(struct sock sk, long timeout) { locksock(sk); tcpclose(sk, timeout); releasesock(sk); if (!sk->sknetrefcnt) inetcskclearxmittimerssync(sk); sockput(sk); }

Which will throw a lockdep warning and then, as expected, deadlock on tcpwritetimer().

A way to reproduce this is by running the reproducer from ef7134c7fc48 and then 'rmmod cifs'. A few seconds later, the deadlock/lockdep warning shows up.

Fix: We shouldn't mess with socket internals ourselves, so do not set sknetrefcnt manually.

Also change sockcreate() to sockcreatekern() for explicitness.

As for non-initnet network namespaces, we deal with it the best way we can -- hold an extra netns reference for server->ssocket and drop it when it's released. This ensures that the netns still exists whenever we need to create/destroy server->ssocket, but is not directly tied to it.

Other sources

Rejected reason: This CVE ID has been rejected or withdrawn by its CVE Numbering Authority.

NVD

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

2 affected componentsFixes available
Linux Linux kernel
Microsoft azl3 kernel 6.6.64.2-9

Event History

Jan 11, 2025
CVE Published
via MITRE·12:35 PM
Rejected
via MITRE·12:35 PM
Data Sourced
via Red Hat·01:02 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·01:15 PM
Description
Mar 27, 2025
Data Sourced
via Launchpad·06:44 PM
Description
Apr 2, 2025
Rejected
via MITRE·03:20 PM
Apr 4, 2025
Data Sourced
via Debian·06:45 PM
DescriptionAffected Software
Apr 12, 2025
Data Sourced
via Ubuntu·06:46 PM
RemedyDescriptionSeverityAffected Software
Oct 2, 2025
Data Sourced
via Microsoft·06:11 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·06:11 AM
Affected Software
Updated
via Microsoft·06:11 AM
DescriptionSeverity

Frequently Asked Questions

1

What is the severity of CVE-2024-54680?

CVE-2024-54680 has been classified with a high severity level due to its potential to cause deadlocks in TCP timers.

2

How do I fix CVE-2024-54680?

To fix CVE-2024-54680, upgrade to the patched version of the Linux kernel that addresses this vulnerability.

3

Which versions of the Linux kernel are affected by CVE-2024-54680?

CVE-2024-54680 affects Linux kernel versions from 6.6.62 to 6.6.68, as well as certain 6.11 and 6.13-rc versions.

4

What components are involved in CVE-2024-54680?

CVE-2024-54680 involves the SMB client component of the Linux kernel, specifically related to TCP timers handling.

5

Is CVE-2024-54680 exploitable remotely?

Yes, CVE-2024-54680 may be exploitable remotely under certain conditions, particularly through network socket interactions.

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