CVE-2024-50121: nfsd: cancel nfsd_shrinker_work using sync mode in nfs4_state_shutdown_net

Published Nov 5, 2024
·
Updated

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

nfsd: cancel nfsdshrinkerwork using sync mode in nfs4stateshutdownnet

In the normal case, when we excute echo 0 > /proc/fs/nfsd/threads, the function nfs4statedestroynet in nfs4stateshutdownnet will release all resources related to the hashed nfs4client. If the nfsdclientshrinker is running concurrently, the expireclient function will first unhash this client and then destroy it. This can lead to the following warning. Additionally, numerous use-after-free errors may occur as well.

nfsdclientshrinker echo 0 > /proc/fs/nfsd/threads

expireclient nfsdshutdownnet unhashclient ... nfs4stateshutdownnet / won't wait shrinker exit / / cancelwork(&nn->nfsdshrinkerwork) nfsdfile for this / won't destroy unhashed client1 / client1 still alive nfs4statedestroynet /

nfsdfilecacheshutdown / trigger warning / kmemcachedestroy(nfsdfileslab) kmemcachedestroy(nfsdfilemarkslab) / release nfsdfile and mark / destroyclient

==================================================================== BUG nfsdfile (Not tainted): Objects remaining in nfsdfile on kmemcacheshutdown() -------------------------------------------------------------------- CPU: 4 UID: 0 PID: 764 Comm: sh Not tainted 6.12.0-rc3+ #1

dumpstacklvl+0x53/0x70 slaberr+0xb0/0xf0 kmemcacheshutdown+0x15c/0x310 kmemcachedestroy+0x66/0x160 nfsdfilecacheshutdown+0xac/0x210 [nfsd] nfsddestroyserv+0x251/0x2a0 [nfsd] nfsdsvc+0x125/0x1e0 [nfsd] writethreads+0x16a/0x2a0 [nfsd] nfsctltransactionwrite+0x74/0xa0 [nfsd] vfswrite+0x1a5/0x6d0 ksyswrite+0xc1/0x160 dosyscall64+0x5f/0x170 entrySYSCALL64afterhwframe+0x76/0x7e

==================================================================== BUG nfsdfilemark (Tainted: G B W ): Objects remaining nfsdfilemark on kmemcacheshutdown() --------------------------------------------------------------------

dumpstacklvl+0x53/0x70 slaberr+0xb0/0xf0 kmemcacheshutdown+0x15c/0x310 kmemcachedestroy+0x66/0x160 nfsdfilecacheshutdown+0xc8/0x210 [nfsd] nfsddestroyserv+0x251/0x2a0 [nfsd] nfsdsvc+0x125/0x1e0 [nfsd] writethreads+0x16a/0x2a0 [nfsd] nfsctltransactionwrite+0x74/0xa0 [nfsd] vfswrite+0x1a5/0x6d0 ksyswrite+0xc1/0x160 dosyscall64+0x5f/0x170 entrySYSCALL64afterhwframe+0x76/0x7e

To resolve this issue, cancel nfsdshrinkerwork using synchronous mode in nfs4stateshutdownnet.

Other sources

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

nfsd: cancel nfsdshrinkerwork using sync mode in nfs4stateshutdownnet

In the normal case, when we excute echo 0 > /proc/fs/nfsd/threads, the function nfs4statedestroynet in nfs4stateshutdownnet will release all resources related to the hashed nfs4client. If the nfsdclientshrinker is running concurrently, the expireclient function will first unhash this client and then destroy it. This can lead to the following warning. Additionally, numerous use-after-free errors may occur as well.

nfsdclientshrinker echo 0 > /proc/fs/nfsd/threads

expireclient nfsdshutdownnet unhashclient ... nfs4stateshutdownnet / won't wait shrinker exit / / cancelwork(&nn->nfsdshrinkerwork) nfsdfile for this / won't destroy unhashed client1 / client1 still alive nfs4statedestroynet /

nfsdfilecacheshutdown / trigger warning / kmemcachedestroy(nfsdfileslab) kmemcachedestroy(nfsdfilemarkslab) / release nfsdfile and mark / destroyclient

==================================================================== BUG nfsdfile (Not tainted): Objects remaining in nfsdfile on kmemcacheshutdown() -------------------------------------------------------------------- CPU: 4 UID: 0 PID: 764 Comm: sh Not tainted 6.12.0-rc3+ #1

dumpstacklvl+0x53/0x70 slaberr+0xb0/0xf0 kmemcacheshutdown+0x15c/0x310 kmemcachedestroy+0x66/0x160 nfsdfilecacheshutdown+0xac/0x210 [nfsd] nfsddestroyserv+0x251/0x2a0 [nfsd] nfsdsvc+0x125/0x1e0 [nfsd] writethreads+0x16a/0x2a0 [nfsd] nfsctltransactionwrite+0x74/0xa0 [nfsd] vfswrite+0x1a5/0x6d0 ksyswrite+0xc1/0x160 dosyscall64+0x5f/0x170 entrySYSCALL64afterhwframe+0x76/0x7e

==================================================================== BUG nfsdfilemark (Tainted: G B W ): Objects remaining nfsdfilemark on kmemcacheshutdown() --------------------------------------------------------------------

dumpstacklvl+0x53/0x70 slaberr+0xb0/0xf0 kmemcacheshutdown+0x15c/0x310 kmemcachedestroy+0x66/0x160 nfsdfilecacheshutdown+0xc8/0x210 [nfsd] nfsddestroyserv+0x251/0x2a0 [nfsd] nfsdsvc+0x125/0x1e0 [nfsd] writethreads+0x16a/0x2a0 [nfsd] nfsctltransactionwrite+0x74/0xa0 [nfsd] vfswrite+0x1a5/0x6d0 ksyswrite+0xc1/0x160 dosyscall64+0x5f/0x170 entrySYSCALL64afterhwframe+0x76/0x7e

To resolve this issue, cancel nfsdshrinkerwork using synchronous mode in nfs4stateshutdownnet.

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

10 affected componentsFixes available
Linux Linux kernel>=5.10.220<5.15
Linux Linux kernel>=5.15.154<6.1
Linux Linux kernel>=6.2<6.6.59
Linux Linux kernel>=6.7<6.11.6
Linux Linux kernel=6.12-rc1
Linux Linux kernel=6.12-rc2
Linux Linux kernel=6.12-rc3
Linux Linux kernel=6.12-rc4
debian/linux<=5.10.223-1
5.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
debian/linux-6.1
6.1.129-1~deb11u1

Event History

Nov 5, 2024
CVE Published
via MITRE·05:10 PM
Data Sourced
via MITRE·05:10 PM
Description
Data Sourced
via Red Hat·06:01 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·06:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Mar 24, 2025
Data Sourced
via Launchpad·12:51 AM
Description
Apr 29, 2025
Data Sourced
via Ubuntu·01:00 AM
RemedyDescriptionSeverityAffected Software
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-50121?

CVE-2024-50121 is classified as a medium severity vulnerability in the Linux kernel.

2

How do I fix CVE-2024-50121?

To fix CVE-2024-50121, you should update your Linux kernel to a version higher than 6.12-rc4 or apply the relevant patches from the Linux maintainers.

3

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

CVE-2024-50121 affects Linux kernel versions from 5.10.220 up to 6.12-rc4 inclusive.

4

Is CVE-2024-50121 a remote execution vulnerability?

CVE-2024-50121 does not appear to be a remote code execution vulnerability; it is related to the NFS daemon and state management.

5

What components of the Linux kernel are impacted by CVE-2024-50121?

CVE-2024-50121 impacts the NFS subsystem, specifically related to the handling of nfsd_shrinker_work in the kernel.

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