{"id":"CVE-2024-56558","state":"PUBLISHED","title":"nfsd: make sure exp active before svc_export_show","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnfsd: make sure exp active before svc_export_show\n\nThe function `e_show` was called with protection from RCU. This only\nensures that `exp` will not be freed. Therefore, the reference count for\n`exp` can drop to zero, which will trigger a refcount use-after-free\nwarning when `exp_get` is called. To resolve this issue, use\n`cache_get_rcu` to ensure that `exp` remains active.\n\n------------[ cut here ]------------\nrefcount_t: addition on 0; use-after-free.\nWARNING: CPU: 3 PID: 819 at lib/refcount.c:25\nrefcount_warn_saturate+0xb1/0x120\nCPU: 3 UID: 0 PID: 819 Comm: cat Not tainted 6.12.0-rc3+ #1\nHardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS\n1.16.1-2.fc37 04/01/2014\nRIP: 0010:refcount_warn_saturate+0xb1/0x120\n...\nCall Trace:\n <TASK>\n e_show+0x20b/0x230 [nfsd]\n seq_read_iter+0x589/0x770\n seq_read+0x1e5/0x270\n vfs_read+0x125/0x530\n ksys_read+0xc1/0x160\n do_syscall_64+0x5f/0x170\n entry_SYSCALL_64_after_hwframe+0x76/0x7e","publishedAt":"2024-12-27T14:23:03.902Z","updatedAt":"2026-08-05T11:45:06.425Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"e2fa0d0e327279a8defb87b263cd0bf288fd9261","versionType":"git"},{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"7fd29d284b55c2274f7a748e6c5f25b4758b8da5","versionType":"git"},{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"6cefcadd34e3c71c81ea64b899a0daa86314a51a","versionType":"git"},{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"7d8f7816bebcd2e7400bb4d786eccb8f33c9f9ec","versionType":"git"},{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"1cecfdbc6bfc89c516d286884c7f29267b95de2b","versionType":"git"},{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"7365d1f8de63cffdbbaa2287ce0205438e1a922f","versionType":"git"},{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"be8f982c369c965faffa198b46060f8853e0f1f0","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nfsd/export.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.17","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.17","versionType":"semver"},{"version":"5.4.287","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.231","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.174","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.120","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.64","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.4","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nfsd/export.c"]}],"references":["https://git.kernel.org/stable/c/e2fa0d0e327279a8defb87b263cd0bf288fd9261","https://git.kernel.org/stable/c/7fd29d284b55c2274f7a748e6c5f25b4758b8da5","https://git.kernel.org/stable/c/6cefcadd34e3c71c81ea64b899a0daa86314a51a","https://git.kernel.org/stable/c/7d8f7816bebcd2e7400bb4d786eccb8f33c9f9ec","https://git.kernel.org/stable/c/1cecfdbc6bfc89c516d286884c7f29267b95de2b","https://git.kernel.org/stable/c/7365d1f8de63cffdbbaa2287ce0205438e1a922f","https://git.kernel.org/stable/c/be8f982c369c965faffa198b46060f8853e0f1f0","https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html","https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:08:12.933Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/56xxx/CVE-2024-56558.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-56558","state":"PUBLISHED","datePublished":"2024-12-27T14:23:03.902Z","dateUpdated":"2026-08-05T11:45:06.425Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-27T14:03:05.992Z"},"containers":{"cna":{"title":"nfsd: make sure exp active before svc_export_show","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnfsd: make sure exp active before svc_export_show\n\nThe function `e_show` was called with protection from RCU. This only\nensures that `exp` will not be freed. Therefore, the reference count for\n`exp` can drop to zero, which will trigger a refcount use-after-free\nwarning when `exp_get` is called. To resolve this issue, use\n`cache_get_rcu` to ensure that `exp` remains active.\n\n------------[ cut here ]------------\nrefcount_t: addition on 0; use-after-free.\nWARNING: CPU: 3 PID: 819 at lib/refcount.c:25\nrefcount_warn_saturate+0xb1/0x120\nCPU: 3 UID: 0 PID: 819 Comm: cat Not tainted 6.12.0-rc3+ #1\nHardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS\n1.16.1-2.fc37 04/01/2014\nRIP: 0010:refcount_warn_saturate+0xb1/0x120\n...\nCall Trace:\n <TASK>\n e_show+0x20b/0x230 [nfsd]\n seq_read_iter+0x589/0x770\n seq_read+0x1e5/0x270\n vfs_read+0x125/0x530\n ksys_read+0xc1/0x160\n do_syscall_64+0x5f/0x170\n entry_SYSCALL_64_after_hwframe+0x76/0x7e"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"e2fa0d0e327279a8defb87b263cd0bf288fd9261","versionType":"git"},{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"7fd29d284b55c2274f7a748e6c5f25b4758b8da5","versionType":"git"},{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"6cefcadd34e3c71c81ea64b899a0daa86314a51a","versionType":"git"},{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"7d8f7816bebcd2e7400bb4d786eccb8f33c9f9ec","versionType":"git"},{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"1cecfdbc6bfc89c516d286884c7f29267b95de2b","versionType":"git"},{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"7365d1f8de63cffdbbaa2287ce0205438e1a922f","versionType":"git"},{"version":"bf18f163e89c52e09c96534db45c4274273a0b34","status":"affected","lessThan":"be8f982c369c965faffa198b46060f8853e0f1f0","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nfsd/export.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.17","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.17","versionType":"semver"},{"version":"5.4.287","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.231","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.174","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.120","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.64","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.4","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nfsd/export.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/e2fa0d0e327279a8defb87b263cd0bf288fd9261"},{"url":"https://git.kernel.org/stable/c/7fd29d284b55c2274f7a748e6c5f25b4758b8da5"},{"url":"https://git.kernel.org/stable/c/6cefcadd34e3c71c81ea64b899a0daa86314a51a"},{"url":"https://git.kernel.org/stable/c/7d8f7816bebcd2e7400bb4d786eccb8f33c9f9ec"},{"url":"https://git.kernel.org/stable/c/1cecfdbc6bfc89c516d286884c7f29267b95de2b"},{"url":"https://git.kernel.org/stable/c/7365d1f8de63cffdbbaa2287ce0205438e1a922f"},{"url":"https://git.kernel.org/stable/c/be8f982c369c965faffa198b46060f8853e0f1f0"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerable `e_show()` path is only entered via `read()` on local pseudo-files (`/proc/fs/nfs/exports`, `/proc/fs/nfsd/exports`, `/proc/fs/nfsd/export_stats`); no remote NFS request reaches this seq_file code.\nAC:L - The attacker fully controls the triggering side and can loop reads across many threads indefinitely, while the freeing side (sunrpc `cache_clean` expiry of export/negative entries) runs continuously on any active NFS server and can be further churned by unauthenticated RPC traffic to local nfsd, so the race is repeatable at will.\nPR:L - `/proc/fs/nfs/exports` defaults to 0444 (`proc_create` mode 0 → `S_IRUGO`) and `/proc/fs/nfsd/{exports,export_stats}` are registered `S_IRUGO` under a 0755 directory, so any unprivileged local user can read them — no capability, namespace trick, or root required.\nUI:N - The attacker performs the read itself; no action by any other user or administrator is needed.\nS:U - The refcount underflow and subsequent use-after-free are confined to the kernel's own memory and the same security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - `svc_export_show()` reads already-freed memory (`ex_stats` was `kfree()`d non-RCU, `ex_client` auth_domain released, `ex_path` dentry/mnt put) and formats it into the seq buffer returned to the unprivileged reader, and the freed percpu counter pointer yields a wild read — a direct kernel heap information disclosure that reclaimed-slab grooming makes attacker-influenceable.\nI:H - On the affected 4.20+ trees without zero-checking `refcount_t`, the bogus 0→1 increment is followed by a matching put that re-runs `svc_export_put()`, producing double `kfree()` of `ex_stats`/`ex_uuid`, double `path_put()`/`auth_domain_put()` and a double `kfree_rcu()` — a double-free/refcount-underflow primitive on kmalloc objects that is a well-established route to arbitrary write and privilege escalation.\nA:H - The `refcount_t: addition on 0` WARNING is an oops splat (immediate panic with `panic_on_warn`), and dereferencing the freed `ex_stats` percpu pointer plus the double-free of dentry/mount/auth_domain references reliably crash the kernel — an unprivileged user can trigger this repeatedly."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:45:06.425Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.17","versionEndExcluding":"5.4.287"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.17","versionEndExcluding":"5.10.231"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.17","versionEndExcluding":"5.15.174"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.17","versionEndExcluding":"6.1.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.17","versionEndExcluding":"6.6.64"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.17","versionEndExcluding":"6.12.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.17","versionEndExcluding":"6.13"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2024-56558","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-02-11T15:42:49.247633Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","type":"CWE","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-02-11T15:45:24.949Z"}},{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T20:49:29.154Z"}}]}}}