# CVE-2024-50301: security/keys: fix slab-out-of-bounds in key\_task\_permission

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.35% (percentile 21, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2024-11-19T01:30:49.982Z
- **Modified:** 2026-10-15T01:19:11.853Z

## Who should check

- Anyone running Linux \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< c3ce634ad953ce48c75c39bdfd8b711dd95f346f; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 4efb69a0e294ef201bcdf7ce3d6202cd0a545a5d; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 1e4332581cd4eed75aea77af6f66cdcdda8b49b9; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 199c20fb7499c79557a075dc24e9a7dae7d9f1ce; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< bbad2d5b6c99db468d8f88b6ba6a56ed409b4881; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 3e79ad156bedf2da0ab909a118d2cec6c9c22b79; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< e0a317ad68e4ea48a0158187238c5407e4fdec8b; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 4a74da044ec9ec8679e6beccc4306b936b62873f
- Anyone running Linux 3.13

## Description

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

security/keys: fix slab-out-of-bounds in key\_task\_permission

KASAN reports an out of bounds read:
BUG: KASAN: slab-out-of-bounds in \_\_kuid\_val include/linux/uidgid.h:36
BUG: KASAN: slab-out-of-bounds in uid\_eq include/linux/uidgid.h:63 \[inline\]
BUG: KASAN: slab-out-of-bounds in key\_task\_permission+0x394/0x410
security/keys/permission.c:54
Read of size 4 at addr ffff88813c3ab618 by task stress-ng/4362

CPU: 2 PID: 4362 Comm: stress-ng Not tainted 5.10.0-14930-gafbffd6c3ede \#15
Call Trace:
 \_\_dump\_stack lib/dump\_stack.c:82 \[inline\]
 dump\_stack+0x107/0x167 lib/dump\_stack.c:123
 print\_address\_description.constprop.0+0x19/0x170 mm/kasan/report.c:400
 \_\_kasan\_report.cold+0x6c/0x84 mm/kasan/report.c:560
 kasan\_report+0x3a/0x50 mm/kasan/report.c:585
 \_\_kuid\_val include/linux/uidgid.h:36 \[inline\]
 uid\_eq include/linux/uidgid.h:63 \[inline\]
 key\_task\_permission+0x394/0x410 security/keys/permission.c:54
 search\_nested\_keyrings+0x90e/0xe90 security/keys/keyring.c:793

This issue was also reported by syzbot.

It can be reproduced by following these steps(more details \[1\]):
1. Obtain more than 32 inputs that have similar hashes, which ends with the
   pattern '0xxxxxxxe6'.
2. Reboot and add the keys obtained in step 1.

The reproducer demonstrates how this issue happened:
1. In the search\_nested\_keyrings function, when it iterates through the
   slots in a node(below tag ascend\_to\_node), if the slot pointer is meta
   and node-\>back\_pointer != NULL(it means a root), it will proceed to
   descend\_to\_node. However, there is an exception. If node is the root,
   and one of the slots points to a shortcut, it will be treated as a
   keyring.
2. Whether the ptr is keyring decided by keyring\_ptr\_is\_keyring function.
   However, KEYRING\_PTR\_SUBTYPE is 0x2UL, the same as
   ASSOC\_ARRAY\_PTR\_SUBTYPE\_MASK.
3. When 32 keys with the similar hashes are added to the tree, the ROOT
   has keys with hashes that are not similar (e.g. slot 0) and it splits
   NODE A without using a shortcut. When NODE A is filled with keys that
   all hashes are xxe6, the keys are similar, NODE A will split with a
   shortcut. Finally, it forms the tree as shown below, where slot 6 points
   to a shortcut.

                      NODE A
              +------\>+---+
      ROOT    \|       \| 0 \| xxe6
      +---+   \|       +---+
 xxxx \| 0 \| shortcut  :   : xxe6
      +---+   \|       +---+
 xxe6 :   :   \|       \|   \| xxe6
      +---+   \|       +---+
      \| 6 \|---+       :   : xxe6
      +---+           +---+
 xxe6 :   :           \| f \| xxe6
      +---+           +---+
 xxe6 \| f \|
      +---+

4. As mentioned above, If a slot(slot 6) of the root points to a shortcut,
   it may be mistakenly transferred to a key\*, leading to a read
   out-of-bounds read.

To fix this issue, one should jump to descend\_to\_node if the ptr is a
shortcut, regardless of whether the node is root or not.

\[1\] https://lore.kernel.org/linux-kernel/1cfa878e-8c7b-4570-8606-21daf5e13ce7@huaweicloud.com/

\[jarkko: tweaked the commit message a bit to have an appropriate closes
 tag.\]

## Affected and fixed versions

- Linux: \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< c3ce634ad953ce48c75c39bdfd8b711dd95f346f; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 4efb69a0e294ef201bcdf7ce3d6202cd0a545a5d; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 1e4332581cd4eed75aea77af6f66cdcdda8b49b9; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 199c20fb7499c79557a075dc24e9a7dae7d9f1ce; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< bbad2d5b6c99db468d8f88b6ba6a56ed409b4881; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 3e79ad156bedf2da0ab909a118d2cec6c9c22b79; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< e0a317ad68e4ea48a0158187238c5407e4fdec8b; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 4a74da044ec9ec8679e6beccc4306b936b62873f (cvelist)
- Linux: 3.13 (cvelist)

## Mitigation

- Upgrade Linux to 4a74da044ec9ec8679e6beccc4306b936b62873f or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-50301. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-50301.md
Affected: Linux >= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, < c3ce634ad953ce48c75c39bdfd8b711dd95f346f; >= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, < 4efb69a0e294ef201bcdf7ce3d6202cd0a545a5d; >= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, < 1e4332581cd4eed75aea77af6f66cdcdda8b49b9; >= b2a4df200d570b2c33a57e1…
Fixed in: Linux 4efb69a0e294ef201bcdf7ce3d6202cd0a545a5d, Linux 1e4332581cd4eed75aea77af6f66cdcdda8b49b9, Linux 199c20fb7499c79557a075dc24e9a7dae7d9f1ce, Linux 3e79ad156bedf2da0ab909a118d2cec6c9c22b79, Linux 4a74da044ec9ec8679e6beccc4306b936b62873f

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-50301 being exploited?

There is no confirmed exploitation: CVE-2024-50301 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.35% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-50301?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-50301?

Linux \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< c3ce634ad953ce48c75c39bdfd8b711dd95f346f; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 4efb69a0e294ef201bcdf7ce3d6202cd0a545a5d; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 1e4332581cd4eed75aea77af6f66cdcdda8b49b9; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 199c20fb7499c79557a075dc24e9a7dae7d9f1ce; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< bbad2d5b6c99db468d8f88b6ba6a56ed409b4881; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 3e79ad156bedf2da0ab909a118d2cec6c9c22b79; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< e0a317ad68e4ea48a0158187238c5407e4fdec8b; \>= b2a4df200d570b2c33a57e1ebfa5896e4bc81b69, \< 4a74da044ec9ec8679e6beccc4306b936b62873f; Linux 3.13.

### Is there a fix for CVE-2024-50301?

Yes. Fixed in Linux 4efb69a0e294ef201bcdf7ce3d6202cd0a545a5d, Linux 1e4332581cd4eed75aea77af6f66cdcdda8b49b9, Linux 199c20fb7499c79557a075dc24e9a7dae7d9f1ce, Linux 3e79ad156bedf2da0ab909a118d2cec6c9c22b79, Linux 4a74da044ec9ec8679e6beccc4306b936b62873f. Upgrade Linux to 4a74da044ec9ec8679e6beccc4306b936b62873f or later.

### How do I check if I'm affected by CVE-2024-50301?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/c3ce634ad953ce48c75c39bdfd8b711dd95f346f>
- patch: <https://git.kernel.org/stable/c/4efb69a0e294ef201bcdf7ce3d6202cd0a545a5d>
- patch: <https://git.kernel.org/stable/c/1e4332581cd4eed75aea77af6f66cdcdda8b49b9>
- patch: <https://git.kernel.org/stable/c/199c20fb7499c79557a075dc24e9a7dae7d9f1ce>
- patch: <https://git.kernel.org/stable/c/bbad2d5b6c99db468d8f88b6ba6a56ed409b4881>
- patch: <https://git.kernel.org/stable/c/3e79ad156bedf2da0ab909a118d2cec6c9c22b79>
- patch: <https://git.kernel.org/stable/c/e0a317ad68e4ea48a0158187238c5407e4fdec8b>
- patch: <https://git.kernel.org/stable/c/4a74da044ec9ec8679e6beccc4306b936b62873f>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-398330.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-265688.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-355557.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-50301>

HTML: <https://flawdb.com/CVE-2024-50301> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-50301>
