CVE-2026-99950: ucount: take the rlimit reference before checking the limit

Published Nov 30, 2026
·
Updated

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

ucount: take the rlimit reference before checking the limit

incrlimitgetucounts() 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 = addreturn(1) -> 1 new = addreturn(1) -> 2 new != 1, no getucounts() new > max -> decunwind subreturn(1) -> 1 (no put)

The count is 1 with no reference held. When CPU1 drops its charge, decrlimitputucounts() takes the count to 0 and puts a reference nobody took, which frees the live struct ucounts, and the usernamespace it pins, with kfreercu(). The mirror interleaving leaks the reference instead.

An unprivileged user reaches this on a kernel with CONFIGUSERNS=y: in a user namespace with RLIMITSIGPENDING 0, one process taking synchronous SIGSEGVs (forced, so overriderlimit 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 rcurefputslowpath+0xf4/0x120 putucounts+0x5a/0x180 dodecrlimitputucounts+0x70/0x90 sigqueuefree+0x33/0xc0 getsignal+0x56f/0xd20 archdosignalorrestart+0x87/0x380 irqentryexit+0x243/0x650 asmexcpagefault+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 dodecrlimitputucounts(), which releases the reference when the count returns to 0. The getucounts() 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.

Affected Software

1 affected component
Linux Linux kernel

Event History

Nov 30, 2026
CVE Published
via MITRE·01:18 PM
Data Sourced
via MITRE·01:18 PM
Description

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