CVE-2024-50301

security/keys: fix slab-out-of-bounds in key_task_permission

HIGH
7.1
CVSS Score
Published: November 19, 2024 at 01:30 AM UTC
Updated: October 15, 2026 at 01:19 AM UTC
15 products affected across 2 vendorsLinux KernelSIMATIC S7-1500 CPU 1518-4 Pn /dp MFP FirmwareSiplus S7-1500 CPU 1518-4 Pn /dp MFP Firmware

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.1
Exploit prediction
EPSS 0.3%
SSVC
No known exploit

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/[email protected]/ [jarkko: tweaked the commit message a bit to have an appropriate closes tag.]

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

3.13 ≤ v < 4.19.3244.20 ≤ v < 5.4.2865.11 ≤ v < 5.15.1725.16 ≤ v < 6.1.1175.5 ≤ v < 5.10.2306.2 ≤ v < 6.6.616.7 ≤ v < 6.11.86.126.12 rc16.12 rc26.12 rc36.12 rc46.12 rc56.12 rc6b2a4df200d570b2c33a57e1ebfa5896e4bc81b69
Vendor states this is fixed in 199c20fb7499c79557a075dc24e9a7dae7d9f1ce (fixed)
Vendor states this is fixed in 1e4332581cd4eed75aea77af6f66cdcdda8b49b9 (fixed)
Vendor states this is fixed in 3e79ad156bedf2da0ab909a118d2cec6c9c22b79 (fixed)
Vendor states this is fixed in 4a74da044ec9ec8679e6beccc4306b936b62873f (fixed)
Vendor states this is fixed in 4efb69a0e294ef201bcdf7ce3d6202cd0a545a5d (fixed)
Vendor states this is fixed in bbad2d5b6c99db468d8f88b6ba6a56ed409b4881 (fixed)
Vendor states this is fixed in c3ce634ad953ce48c75c39bdfd8b711dd95f346f (fixed)
Vendor states this is fixed in e0a317ad68e4ea48a0158187238c5407e4fdec8b (fixed)
Vendor states this is fixed in 3.13 (unaffected)
Vendor states this is fixed in 4.19.324 (unaffected)
Vendor states this is fixed in 5.10.230 (unaffected)
Vendor states this is fixed in 5.15.172 (unaffected)
Vendor states this is fixed in 5.4.286 (unaffected)
Vendor states this is fixed in 6.1.117 (unaffected)
Vendor states this is fixed in 6.11.8 (unaffected)
Vendor states this is fixed in 6.12 (unaffected)
Vendor states this is fixed in 6.6.61 (unaffected)
v < V3.2
Affected range stops below V3.2, so it looks safe — our inference, not a vendor statement
v < V3.2
Affected range stops below V3.2, so it looks safe — our inference, not a vendor statement
v < V3.2
Affected range stops below V3.2, so it looks safe — our inference, not a vendor statement
v < V3.2
Affected range stops below V3.2, so it looks safe — our inference, not a vendor statement
v < V3.2
Affected range stops below V3.2, so it looks safe — our inference, not a vendor statement
v < V3.2
Affected range stops below V3.2, so it looks safe — our inference, not a vendor statement
v < V3.2
Affected range stops below V3.2, so it looks safe — our inference, not a vendor statement
v < V3.2
Affected range stops below V3.2, so it looks safe — our inference, not a vendor statement
v < V3.2
Affected range stops below V3.2, so it looks safe — our inference, not a vendor statement

References (13)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/199c20fb7499c79557a075dc24e9a7dae7d9f1ce
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/1e4332581cd4eed75aea77af6f66cdcdda8b49b9
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/3e79ad156bedf2da0ab909a118d2cec6c9c22b79
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/4a74da044ec9ec8679e6beccc4306b936b62873f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/4efb69a0e294ef201bcdf7ce3d6202cd0a545a5d
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/bbad2d5b6c99db468d8f88b6ba6a56ed409b4881
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/c3ce634ad953ce48c75c39bdfd8b711dd95f346f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e0a317ad68e4ea48a0158187238c5407e4fdec8b

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.1HIGHCISA-ADP
Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-125

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card