CVE-2026-99950
published high CVSS 3.1 · 7.8ucount: take the rlimit reference before checking the limit
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux15bc01effefe97757ef02ca09e9d1b927ab22725 to < 7c9610bdd63f8f5dce3f18d83e63a2fd9e2f1b0f · 15bc01effefe97757ef02ca09e9d1b927ab22725 to < c8124930acec2dda2b157982aa245ca2d2f5474b · 15bc01effefe97757ef02ca09e9d1b927ab22725 to < 20fef6cd188b1f584e98a607a78166b3ff745a69 · 15bc01effefe97757ef02ca09e9d1b927ab22725 to < b505e2bf49547930fa89f7ffeaed7ccb6737a93b · 15bc01effefe97757ef02ca09e9d1b927ab22725 to < 4429d405124e6199092f029afd5630c84019d6f9 · 15bc01effefe97757ef02ca09e9d1b927ab22725 to < 98813eecf7555d35031ad8103c6a4eb14836e61c · 15bc01effefe97757ef02ca09e9d1b927ab22725 to < b14fcabd34e02c40f72d3cd1e9bd4fd18df40ff1 · e8735e2e306f1c9c8b3a4b9218a349f7d96e3df6 · 5.14.15 to < 5.15 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.15 (affected) · 0 to < 5.15 (unaffected · semver) · 5.15.226 through 5.15.* (unaffected · semver) · 6.1.193 through 6.1.* (unaffected · semver) · 6.6.163 through 6.6.* (unaffected · semver) · 6.12.117 through 6.12.* (unaffected · semver) · 6.18.63 through 6.18.* (unaffected · semver) · 7.3.4 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Pending Fix; Not Affected | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Pending Fix | Not stated | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: ucount: take the rlimit reference before checking the limit inc_rlimit_get_ucounts() takes the reference that pins a ucounts level while its rlimit count is non-zero only in the walk whose increment is the 0 -> 1 transition, and only after that walk passed the limit check. A walk that raises the count from zero and then fails the limit backs out without the reference, while a concurrent walk that raised it past one keeps its increment and never takes one either: CPU0 (obeys the limit) CPU1 (overrides it) new = add_return(1) -> 1 new = add_return(1) -> 2 new != 1, no get_ucounts() new > max -> dec_unwind sub_return(1) -> 1 (no put) The count is 1 with no reference held. When CPU1 drops its charge, dec_rlimit_put_ucounts() takes the count to 0 and puts a reference nobody took, which frees the live struct ucounts, and the user_namespace it pins, with kfree_rcu(). The mirror interleaving leaks the reference instead. An unprivileged user reaches this on a kernel with CONFIG_USER_NS=y: in a user namespace with RLIMIT_SIGPENDING 0, one process taking synchronous SIGSEGVs (forced, so override_rlimit is set) races a second process in the same namespace and uid that queues real-time signals, which obey the limit. The two hold different sighand->siglock but charge the same per-namespace SIGPENDING ucounts. Unpatched, with rcuref debugging: rcuref - imbalanced put() WARNING: lib/rcuref.c:266 at rcuref_put_slowpath+0xf4/0x120 put_ucounts+0x5a/0x180 do_dec_rlimit_put_ucounts+0x70/0x90 __sigqueue_free+0x33/0xc0 get_signal+0x56f/0xd20 arch_do_signal_or_restart+0x87/0x380 irqentry_exit+0x243/0x650 asm_exc_page_fault+0x26/0x30 Take the reference on the 0 -> 1 transition before the limit is checked, so the walk that raises the count from zero owns that level's reference even when its request is rejected, and unwind a rejected level through do_dec_rlimit_put_ucounts(), which releases the reference when the count returns to 0. The get_ucounts() failure path is unchanged. With the patch the same interleaving, forced some 80000 times in a KASAN build, produces no warning and no KASAN report.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The charge comes from local signal syscalls: rt_sigqueueinfo/sigqueue for a real-time signal (override_rlimit 0) and kill(self, SIGUSR1) or a forced SIGSEGV (override 1). Both go through __send_signal_locked -> sig_get_ucounts -> inc_rlimit_get_ucounts on the target's own ucounts. No remote peer supplies any data. AC:L - The attacker owns both racing processes. One is rejected at level 1 on the 0->1 add (ns->rlimit_max is 0) while the other adds 1->2 with override, and they take different sighand->siglock, so nothing serialises them. A lost race is harmless or only leaks a reference, so the loop can be retried indefinitely. PR:L - An ordinary user sets RLIMIT_SIGPENDING to 0 and runs unshare(CLONE_NEWUSER); create_user_ns() copies that limit into ns->rlimit_max. Lowering an rlimit, creating a user namespace and signalling your own processes need no real capability. UI:N - No victim is involved: the attacker creates the namespace and runs both the sender that obeys the limit and the one that overrides it. S:U - The freed struct ucounts is a kernel object, so the damage stays within the kernel's own security authority. No VM, IOMMU or sandbox boundary is crossed. C:H - A won race leaves an rlimit count of 1 with no reference behind it, so dec_rlimit_put_ucounts() drops the last reference and put_ucounts() frees ns->ucounts while B->ucounts still points at it (nested userns). The freed kmalloc object can be reclaimed with attacker-controlled data and is reached again through iter->ns->ucounts walks. I:H - Every later signal charge in the namespace does atomic_long_add/sub on rlimit[] of the freed ucounts. Tearing the namespace down calls put_ucounts/put_user_ns on it again (a double free). Both are heap write primitives usable for privilege escalation. A:H - A use-after-free and double free of struct ucounts, along with the user_namespace reference it drops, leads to rcuref imbalance warnings, KASAN reports and kernel oopses.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 15bc01effefe97757ef02ca09e9d1b927ab22725 to < 7c9610bdd63f8f5dce3f18d83e63a2fd9e2f1b0f (affected · git)15bc01effefe97757ef02ca09e9d1b927ab22725 to < c8124930acec2dda2b157982aa245ca2d2f5474b (affected · git)15bc01effefe97757ef02ca09e9d1b927ab22725 to < 20fef6cd188b1f584e98a607a78166b3ff745a69 (affected · git)15bc01effefe97757ef02ca09e9d1b927ab22725 to < b505e2bf49547930fa89f7ffeaed7ccb6737a93b (affected · git)15bc01effefe97757ef02ca09e9d1b927ab22725 to < 4429d405124e6199092f029afd5630c84019d6f9 (affected · git)15bc01effefe97757ef02ca09e9d1b927ab22725 to < 98813eecf7555d35031ad8103c6a4eb14836e61c (affected · git)15bc01effefe97757ef02ca09e9d1b927ab22725 to < b14fcabd34e02c40f72d3cd1e9bd4fd18df40ff1 (affected · git)e8735e2e306f1c9c8b3a4b9218a349f7d96e3df6 (affected · git)5.14.15 to < 5.15 (affected · semver)Default: unaffected | Linux · cna |
| Linux | Linux | 5.15 (affected)0 to < 5.15 (unaffected · semver)5.15.226 through 5.15.* (unaffected · semver)6.1.193 through 6.1.* (unaffected · semver)6.6.163 through 6.6.* (unaffected · semver)6.12.117 through 6.12.* (unaffected · semver)6.18.63 through 6.18.* (unaffected · semver)7.3.4 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
7- https://git.kernel.org/stable/c/20fef6cd188b1f584e98a607a78166b3ff745a69
- https://git.kernel.org/stable/c/4429d405124e6199092f029afd5630c84019d6f9
- https://git.kernel.org/stable/c/7c9610bdd63f8f5dce3f18d83e63a2fd9e2f1b0f
- https://git.kernel.org/stable/c/98813eecf7555d35031ad8103c6a4eb14836e61c
- https://git.kernel.org/stable/c/b14fcabd34e02c40f72d3cd1e9bd4fd18df40ff1
- https://git.kernel.org/stable/c/b505e2bf49547930fa89f7ffeaed7ccb6737a93b
- https://git.kernel.org/stable/c/c8124930acec2dda2b157982aa245ca2d2f5474b
Provider assertions
1Linux · cna
ucount: take the rlimit reference before checking the limit
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 37438ec4ef697a499b603d2476debcbb7a1ab91d501875613e30937afd766f01
- Ingested
- 01 Dec 2026, 05:47:23 UTC
- Source record
- Official CVE record