VDB

CVE-2024-50121

CVE-2024-50121 PUBLISHED CVSS 7.8 HIGH

nfsd: cancel nfsd_shrinker_work using sync mode in nfs4_state_shutdown_net

Reported by linux · Published November 5, 2024

In the Linux kernel, the following vulnerability has been resolved: nfsd: cancel nfsd_shrinker_work using sync mode in nfs4_state_shutdown_net In the normal case, when we excute `echo 0 > /proc/fs/nfsd/threads`, the function `nfs4_state_destroy_net` in `nfs4_state_shutdown_net` will release all resources related to the hashed `nfs4_client`. If the `nfsd_client_shrinker` is running concurrently, the `expire_client` 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. nfsd_client_shrinker echo 0 > /proc/fs/nfsd/threads expire_client nfsd_shutdown_net unhash_client ... nfs4_state_shutdown_net /* won't wait shrinker exit */ /* cancel_work(&nn->nfsd_shrinker_work) * nfsd_file for this /* won't destroy unhashed client1 */ * client1 still alive nfs4_state_destroy_net */ nfsd_file_cache_shutdown /* trigger warning */ kmem_cache_destroy(nfsd_file_slab) kmem_cache_destroy(nfsd_file_mark_slab) /* release nfsd_file and mark */ __destroy_client ==================================================================== BUG nfsd_file (Not tainted): Objects remaining in nfsd_file on __kmem_cache_shutdown() -------------------------------------------------------------------- CPU: 4 UID: 0 PID: 764 Comm: sh Not tainted 6.12.0-rc3+ #1 dump_stack_lvl+0x53/0x70 slab_err+0xb0/0xf0 __kmem_cache_shutdown+0x15c/0x310 kmem_cache_destroy+0x66/0x160 nfsd_file_cache_shutdown+0xac/0x210 [nfsd] nfsd_destroy_serv+0x251/0x2a0 [nfsd] nfsd_svc+0x125/0x1e0 [nfsd] write_threads+0x16a/0x2a0 [nfsd] nfsctl_transaction_write+0x74/0xa0 [nfsd] vfs_write+0x1a5/0x6d0 ksys_write+0xc1/0x160 do_syscall_64+0x5f/0x170 entry_SYSCALL_64_after_hwframe+0x76/0x7e ==================================================================== BUG nfsd_file_mark (Tainted: G B W ): Objects remaining nfsd_file_mark on __kmem_cache_shutdown() -------------------------------------------------------------------- dump_stack_lvl+0x53/0x70 slab_err+0xb0/0xf0 __kmem_cache_shutdown+0x15c/0x310 kmem_cache_destroy+0x66/0x160 nfsd_file_cache_shutdown+0xc8/0x210 [nfsd] nfsd_destroy_serv+0x251/0x2a0 [nfsd] nfsd_svc+0x125/0x1e0 [nfsd] write_threads+0x16a/0x2a0 [nfsd] nfsctl_transaction_write+0x74/0xa0 [nfsd] vfs_write+0x1a5/0x6d0 ksys_write+0xc1/0x160 do_syscall_64+0x5f/0x170 entry_SYSCALL_64_after_hwframe+0x76/0x7e To resolve this issue, cancel `nfsd_shrinker_work` using synchronous mode in nfs4_state_shutdown_net.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
kernel-toolsAmazon Linux6.1.124-134.200.amzn2023
kernel-livepatch-6.1.124-134.200Amazon Linux1.0-0.amzn2023
kernel-modules-extra-commonAmazon Linux6.1.124-134.200.amzn2023
kernel-headersAmazon Linux6.1.124-134.200.amzn2023
kernel-libbpfAmazon Linux6.1.124-134.200.amzn2023
linux_kernellinux6.11.6, 6.6.59, 6.1, 5.15

Risk scores

CVSS 3.1
7.8
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected products

VendorProductVersions
LinuxLinux2bbf10861d51dae76c6da7113516d0071c782653, 958294a3eb82026fcfff20b0287a90e9c854785e, f3ea5ec83d1a827f074b2b660749817e0bf2b23e
LinuxLinux6.2, 0, 5.10.233
amazon:2023kernel-tools0
amazon:2023kernel-livepatch-6.1.124-134.2000
amazon:2023kernel-modules-extra-common0
amazon:2023kernel-headers0
amazon:2023kernel-libbpf0
linuxlinux_kernel5.10.220, 6.1.81, 5.15.154
amazon:2023kernel-tools-devel0
amazon:2023bpftool0
amazon:2023perf0
amazon:2023kernel-devel0
LinuxLinux6.1.81, 6.11.6, 6.12
amazon:2023kernel0
amazon:2023python3-perf0
amazon:2023kernel-libbpf-static0
amazon:2023kernel-libbpf-devel0
SiemensSIMATIC S7-1500 TM MFP - GNU/Linux subsystem0
amazon:2023kernel-modules-extra0

Timeline

  • Nov 5, 2024 Coalition ESS Score (19 in total, the first dated here)
  • Nov 5, 2024 CVE Published
  • Nov 6, 2024 EPSS Score (30 in total, the first dated here)
  • Dec 16, 2025 PoC Published
  • Jan 2, 2026 Security Advisory (195 in total, the first dated here)
  • Apr 29, 2026 Distribution Patch (154 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2024-50121
vulnetix vdb fixes CVE-2024-50121

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-50121/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›