| From bippy-7c5fe7eed585 Mon Sep 17 00:00:00 2001 |
| From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| To: <linux-cve-announce@vger.kernel.org> |
| Reply-to: <cve@kernel.org>, <linux-kernel@vger.kernel.org> |
| Subject: CVE-2025-21893: keys: Fix UAF in key_put() |
| |
| Description |
| =========== |
| |
| In the Linux kernel, the following vulnerability has been resolved: |
| |
| keys: Fix UAF in key_put() |
| |
| Once a key's reference count has been reduced to 0, the garbage collector |
| thread may destroy it at any time and so key_put() is not allowed to touch |
| the key after that point. The most key_put() is normally allowed to do is |
| to touch key_gc_work as that's a static global variable. |
| |
| However, in an effort to speed up the reclamation of quota, this is now |
| done in key_put() once the key's usage is reduced to 0 - but now the code |
| is looking at the key after the deadline, which is forbidden. |
| |
| Fix this by using a flag to indicate that a key can be gc'd now rather than |
| looking at the key's refcount in the garbage collector. |
| |
| The Linux kernel CVE team has assigned CVE-2025-21893 to this issue. |
| |
| |
| Affected and fixed versions |
| =========================== |
| |
| Issue introduced in 6.10 with commit 9578e327b2b4935a25d49e3891b8fcca9b6c10c6 and fixed in 6.12.21 with commit 6afe2ea2daec156bd94ad2c5a6f4f4c48240dcd3 |
| Issue introduced in 6.10 with commit 9578e327b2b4935a25d49e3891b8fcca9b6c10c6 and fixed in 6.13.9 with commit f6a3cf833188e897c97028cd7b926e3f2cb1a8c0 |
| Issue introduced in 6.10 with commit 9578e327b2b4935a25d49e3891b8fcca9b6c10c6 and fixed in 6.14 with commit 75845c6c1a64483e9985302793dbf0dfa5f71e32 |
| |
| Please see https://www.kernel.org for a full list of currently supported |
| kernel versions by the kernel community. |
| |
| Unaffected versions might change over time as fixes are backported to |
| older supported kernel versions. The official CVE entry at |
| https://cve.org/CVERecord/?id=CVE-2025-21893 |
| will be updated if fixes are backported, please check that for the most |
| up to date information about this issue. |
| |
| |
| Affected files |
| ============== |
| |
| The file(s) affected by this issue are: |
| include/linux/key.h |
| security/keys/gc.c |
| security/keys/key.c |
| |
| |
| Mitigation |
| ========== |
| |
| The Linux kernel CVE team recommends that you update to the latest |
| stable kernel version for this, and many other bugfixes. Individual |
| changes are never tested alone, but rather are part of a larger kernel |
| release. Cherry-picking individual commits is not recommended or |
| supported by the Linux kernel community at all. If however, updating to |
| the latest release is impossible, the individual changes to resolve this |
| issue can be found at these commits: |
| https://git.kernel.org/stable/c/6afe2ea2daec156bd94ad2c5a6f4f4c48240dcd3 |
| https://git.kernel.org/stable/c/f6a3cf833188e897c97028cd7b926e3f2cb1a8c0 |
| https://git.kernel.org/stable/c/75845c6c1a64483e9985302793dbf0dfa5f71e32 |