FlawAtlas
Search the atlas
UBUNTU-CVE-2024-50301 High

UBUNTU-CVE-2024-50301

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.]

Exploit probability Not scored
Published November 19, 2024
Required by Not available
Last source change August 19, 2026

02 / AFFECTED SOFTWARE

Affected packages

Ubuntu:22.04:LTS linux-starfive-6.5

11 explicit affected versions

Ubuntu:20.04:LTS linux-intel-iotg-5.15

41 explicit affected versions

Ubuntu:22.04:LTS linux-ibm

57 explicit affected versions

Ubuntu:18.04:LTS linux-oem

50 explicit affected versions

Ubuntu:18.04:LTS linux-aws-5.0

6 explicit affected versions

Ubuntu:20.04:LTS linux-aws-5.11

12 explicit affected versions

Ubuntu:22.04:LTS linux-oem-6.5

19 explicit affected versions

Ubuntu:20.04:LTS linux-raspi2

6 explicit affected versions

Ubuntu:22.04:LTS linux

67 explicit affected versions

Ubuntu:24.04:LTS linux-riscv

21 explicit affected versions

Ubuntu:22.04:LTS linux-gkeop

52 explicit affected versions

Ubuntu:Pro:FIPS-updates:20.04:LTS linux-fips

72 explicit affected versions

Ubuntu:22.04:LTS linux-azure

60 explicit affected versions

Ubuntu:20.04:LTS linux-lowlatency-hwe-5.15

53 explicit affected versions

Ubuntu:22.04:LTS linux-riscv-6.5

10 explicit affected versions

Ubuntu:22.04:LTS linux-ibm-6.8

12 explicit affected versions

Ubuntu:24.04:LTS linux-oem-6.8

19 explicit affected versions

Ubuntu:22.04:LTS linux-gke

59 explicit affected versions

Ubuntu:Pro:14.04:LTS linux

191 explicit affected versions

Ubuntu:22.04:LTS linux-azure-5.19

7 explicit affected versions

Ubuntu:22.04:LTS linux-raspi

58 explicit affected versions

Ubuntu:22.04:LTS linux-oracle-6.8

16 explicit affected versions

Ubuntu:20.04:LTS linux-kvm

99 explicit affected versions

Ubuntu:22.04:LTS linux-gcp-6.5

13 explicit affected versions

Ubuntu:Pro:FIPS-updates:18.04:LTS linux-azure-fips

85 explicit affected versions

Ubuntu:24.04:LTS linux-nvidia

18 explicit affected versions

Ubuntu:20.04:LTS linux-oem-5.14

35 explicit affected versions

Ubuntu:Pro:FIPS-updates:22.04:LTS linux-gcp-fips

19 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-tegra

19 explicit affected versions

Ubuntu:20.04:LTS linux-gke-5.15

18 explicit affected versions

Ubuntu:Pro:FIPS-updates:22.04:LTS linux-azure-fips

18 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-oracle

118 explicit affected versions

Ubuntu:22.04:LTS linux-azure-fde

41 explicit affected versions

Ubuntu:24.04:LTS linux-oracle

21 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-hwe-5.4

101 explicit affected versions

Ubuntu:20.04:LTS linux-aws-5.13

13 explicit affected versions

Ubuntu:20.04:LTS linux-aws-5.8

4 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-kvm

121 explicit affected versions

Ubuntu:16.04:LTS linux-hwe-edge

23 explicit affected versions

Ubuntu:24.04:LTS linux

26 explicit affected versions

Ubuntu:Pro:FIPS:18.04:LTS linux-gcp-fips

1 explicit affected versions

Ubuntu:24.04:LTS linux-raspi-realtime

1 explicit affected versions

Ubuntu:20.04:LTS linux-hwe-5.8

21 explicit affected versions

Ubuntu:20.04:LTS linux-hwe-5.13

16 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency-hwe-6.2

10 explicit affected versions

Ubuntu:Pro:FIPS-updates:20.04:LTS linux-aws-fips

56 explicit affected versions

Ubuntu:24.04:LTS linux-aws

22 explicit affected versions

Ubuntu:18.04:LTS linux-oracle-5.0

7 explicit affected versions

Ubuntu:20.04:LTS linux-riscv

12 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-oracle

111 explicit affected versions

Ubuntu:24.04:LTS linux-azure-6.11

1 explicit affected versions

Ubuntu:20.04:LTS linux-riscv-5.15

50 explicit affected versions

Ubuntu:20.04:LTS linux-gcp-5.11

12 explicit affected versions

Ubuntu:22.04:LTS linux-azure-6.5

14 explicit affected versions

Ubuntu:20.04:LTS linux-intel-5.13

7 explicit affected versions

Ubuntu:24.04:LTS linux-nvidia-tegra

2 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-azure-5.4

88 explicit affected versions

Ubuntu:20.04:LTS linux-oem-5.13

12 explicit affected versions

Ubuntu:20.04:LTS linux-gcp

104 explicit affected versions

Ubuntu:20.04:LTS linux

112 explicit affected versions

Ubuntu:20.04:LTS linux-oracle-5.11

12 explicit affected versions

Ubuntu:Pro:Realtime:22.04:LTS linux-realtime-6.8

16 explicit affected versions

Ubuntu:20.04:LTS linux-azure

99 explicit affected versions

Ubuntu:Pro:14.04:LTS linux-aws

120 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-tegra-igx

15 explicit affected versions

Ubuntu:22.04:LTS linux-azure-6.8

13 explicit affected versions

Ubuntu:24.04:LTS linux-gkeop

8 explicit affected versions

Ubuntu:18.04:LTS linux-hwe-edge

10 explicit affected versions

Ubuntu:18.04:LTS linux-gke-5.4

37 explicit affected versions

Ubuntu:24.04:LTS linux-azure-nvidia

1 explicit affected versions

Ubuntu:22.04:LTS linux-oracle-6.5

13 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency-hwe-6.8

14 explicit affected versions

Ubuntu:22.04:LTS linux-azure-fde-6.2

10 explicit affected versions

Ubuntu:Pro:Realtime:22.04:LTS linux-intel-iot-realtime

34 explicit affected versions

Ubuntu:Pro:FIPS:20.04:LTS linux-aws-fips

1 explicit affected versions

Ubuntu:20.04:LTS linux-iot

37 explicit affected versions

Ubuntu:20.04:LTS linux-oem-5.10

26 explicit affected versions

Ubuntu:20.04:LTS linux-gcp-5.13

13 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-aws

144 explicit affected versions

Ubuntu:22.04:LTS linux-xilinx-zynqmp

12 explicit affected versions

Ubuntu:Pro:FIPS:18.04:LTS linux-fips

1 explicit affected versions

Ubuntu:20.04:LTS linux-oem-5.6

29 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-gcp-5.4

92 explicit affected versions

Ubuntu:18.04:LTS linux-gcp-5.3

13 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency

64 explicit affected versions

Ubuntu:24.04:LTS linux-nvidia-lowlatency

15 explicit affected versions

Ubuntu:22.04:LTS linux-gcp-6.8

16 explicit affected versions

Ubuntu:Pro:FIPS:18.04:LTS linux-azure-fips

1 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-raspi-5.4

87 explicit affected versions

Ubuntu:22.04:LTS linux-aws

59 explicit affected versions

Ubuntu:20.04:LTS linux-aws

104 explicit affected versions

Ubuntu:Pro:FIPS-updates:22.04:LTS linux-aws-fips

22 explicit affected versions

Ubuntu:18.04:LTS linux-gke-4.15

33 explicit affected versions

Ubuntu:22.04:LTS linux-riscv

23 explicit affected versions

Ubuntu:18.04:LTS linux-aws-5.3

10 explicit affected versions

Ubuntu:Pro:FIPS-updates:24.04:LTS linux-fips

1 explicit affected versions

Ubuntu:Pro:16.04:LTS linux

188 explicit affected versions

Ubuntu:Nvidia-BlueField:24.04:LTS linux-bluefield

11 explicit affected versions

Ubuntu:20.04:LTS linux-hwe-5.11

12 explicit affected versions

Ubuntu:20.04:LTS linux-azure-5.8

7 explicit affected versions

Ubuntu:22.04:LTS linux-gcp-6.2

12 explicit affected versions

Ubuntu:20.04:LTS linux-oracle

102 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-gcp

138 explicit affected versions

Ubuntu:Pro:FIPS:16.04:LTS linux-fips

2 explicit affected versions

Ubuntu:20.04:LTS linux-oracle-5.15

50 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia

44 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-kvm

132 explicit affected versions

Ubuntu:22.04:LTS linux-oracle

60 explicit affected versions

Ubuntu:Pro:14.04:LTS linux-lts-xenial

165 explicit affected versions

Ubuntu:Pro:18.04:LTS linux

154 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency-hwe-5.19

10 explicit affected versions

Ubuntu:22.04:LTS linux-oem-5.17

26 explicit affected versions

Ubuntu:24.04:LTS linux-azure

20 explicit affected versions

Ubuntu:20.04:LTS linux-xilinx-zynqmp

37 explicit affected versions

Ubuntu:Pro:FIPS-preview:22.04:LTS linux-azure-fips

1 explicit affected versions

Ubuntu:22.04:LTS linux-hwe-6.8

11 explicit affected versions

Ubuntu:24.04:LTS linux-raspi

23 explicit affected versions

Ubuntu:22.04:LTS linux-azure-6.2

13 explicit affected versions

Ubuntu:24.04:LTS linux-ibm

21 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-aws

139 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-ibm-5.4

62 explicit affected versions

Ubuntu:22.04:LTS linux-oem-6.0

16 explicit affected versions

Ubuntu:22.04:LTS linux-kvm

63 explicit affected versions

Ubuntu:24.04:LTS linux-gcp

24 explicit affected versions

Ubuntu:20.04:LTS linux-gcp-5.15

51 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-aws-hwe

116 explicit affected versions

Ubuntu:22.04:LTS linux-azure-fde-5.19

3 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-gcp-4.15

93 explicit affected versions

Ubuntu:Pro:FIPS:20.04:LTS linux-azure-fips

1 explicit affected versions

Ubuntu:24.04:LTS linux-gcp-6.11

1 explicit affected versions

Ubuntu:Pro:FIPS-preview:22.04:LTS linux-aws-fips

2 explicit affected versions

Ubuntu:20.04:LTS linux-ibm

69 explicit affected versions

Ubuntu:20.04:LTS linux-gke

51 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-azure-4.15

92 explicit affected versions

Ubuntu:24.04:LTS linux-oem-6.11

7 explicit affected versions

Ubuntu:Pro:Realtime:24.04:LTS linux-raspi-realtime

20 explicit affected versions

Ubuntu:20.04:LTS linux-azure-5.13

12 explicit affected versions

Ubuntu:22.04:LTS linux-intel-iotg

47 explicit affected versions

Ubuntu:22.04:LTS linux-oem-6.1

27 explicit affected versions

Ubuntu:Nvidia-BlueField:22.04:LTS linux-bluefield

34 explicit affected versions

Ubuntu:Pro:FIPS:18.04:LTS linux-aws-fips

1 explicit affected versions

Ubuntu:Pro:FIPS:20.04:LTS linux-fips

1 explicit affected versions

Ubuntu:Pro:FIPS-updates:18.04:LTS linux-fips

98 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-6.8

17 explicit affected versions

Ubuntu:22.04:LTS linux-gcp-5.19

8 explicit affected versions

Ubuntu:Pro:FIPS-updates:22.04:LTS linux-fips

24 explicit affected versions

Ubuntu:20.04:LTS linux-oracle-5.8

5 explicit affected versions

Ubuntu:22.04:LTS linux-riscv-5.19

8 explicit affected versions

Ubuntu:Pro:FIPS:20.04:LTS linux-gcp-fips

1 explicit affected versions

Ubuntu:22.04:LTS linux-hwe-6.2

10 explicit affected versions

Ubuntu:Pro:Realtime:24.04:LTS linux-realtime

20 explicit affected versions

Ubuntu:22.04:LTS linux-lowlatency-hwe-6.5

13 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-oracle-5.4

91 explicit affected versions

Ubuntu:20.04:LTS linux-azure-5.11

13 explicit affected versions

Ubuntu:Pro:FIPS-updates:20.04:LTS linux-azure-fips

55 explicit affected versions

Ubuntu:22.04:LTS linux-starfive-5.19

7 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-azure

140 explicit affected versions

Ubuntu:24.04:LTS linux-nvidia-6.11

2 explicit affected versions

Ubuntu:Pro:FIPS-updates:18.04:LTS linux-aws-fips

94 explicit affected versions

Ubuntu:20.04:LTS linux-azure-5.15

52 explicit affected versions

Ubuntu:20.04:LTS linux-riscv-5.8

10 explicit affected versions

Ubuntu:20.04:LTS linux-oracle-5.13

12 explicit affected versions

Ubuntu:Pro:20.04:LTS linux-nvidia-tegra-5.15

15 explicit affected versions

Ubuntu:Pro:18.04:LTS linux-aws-5.4

91 explicit affected versions

Ubuntu:18.04:LTS linux-azure

44 explicit affected versions

Ubuntu:18.04:LTS linux-azure-5.3

16 explicit affected versions

Ubuntu:22.04:LTS linux-starfive-6.2

3 explicit affected versions

Ubuntu:20.04:LTS linux-riscv-5.11

13 explicit affected versions

Ubuntu:20.04:LTS linux-azure-fde

26 explicit affected versions

Ubuntu:20.04:LTS linux-gkeop-5.15

45 explicit affected versions

Ubuntu:18.04:LTS linux-gkeop-5.4

37 explicit affected versions

Ubuntu:24.04:LTS linux-lowlatency

25 explicit affected versions

Ubuntu:22.04:LTS linux-aws-6.5

14 explicit affected versions

Ubuntu:18.04:LTS linux-gcp

38 explicit affected versions

Ubuntu:Pro:16.04:LTS linux-hwe

167 explicit affected versions

Ubuntu:20.04:LTS linux-hwe-5.15

52 explicit affected versions

Ubuntu:18.04:LTS linux-oracle-5.3

9 explicit affected versions

Ubuntu:20.04:LTS linux-aws-5.15

51 explicit affected versions

Ubuntu:22.04:LTS linux-hwe-5.19

11 explicit affected versions

Ubuntu:22.04:LTS linux-riscv-6.8

15 explicit affected versions

Ubuntu:24.04:LTS linux-xilinx

7 explicit affected versions

Ubuntu:22.04:LTS linux-gcp

60 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-6.2

7 explicit affected versions

Ubuntu:20.04:LTS linux-ibm-5.15

33 explicit affected versions

Ubuntu:Pro:FIPS:16.04:LTS linux-fips

97 explicit affected versions

Ubuntu:20.04:LTS linux-bluefield

63 explicit affected versions

Ubuntu:Pro:14.04:LTS linux-azure

121 explicit affected versions

Ubuntu:20.04:LTS linux-gcp-5.8

4 explicit affected versions

Ubuntu:24.04:LTS linux-realtime

1 explicit affected versions

Ubuntu:Pro:FIPS-preview:22.04:LTS linux-fips

1 explicit affected versions

Ubuntu:Pro:FIPS-preview:22.04:LTS linux-gcp-fips

1 explicit affected versions

Ubuntu:Pro:Realtime:22.04:LTS linux-realtime

58 explicit affected versions

Ubuntu:22.04:LTS linux-hwe-6.5

13 explicit affected versions

Ubuntu:18.04:LTS linux-hwe

43 explicit affected versions

Ubuntu:Pro:FIPS-updates:20.04:LTS linux-gcp-fips

57 explicit affected versions

Ubuntu:22.04:LTS linux-aws-5.19

10 explicit affected versions

Ubuntu:22.04:LTS linux-allwinner-5.19

8 explicit affected versions

Ubuntu:24.04:LTS linux-gke

19 explicit affected versions

Ubuntu:22.04:LTS linux-aws-6.2

14 explicit affected versions

Ubuntu:20.04:LTS linux-raspi

92 explicit affected versions

Ubuntu:18.04:LTS linux-azure-edge

4 explicit affected versions

Ubuntu:20.04:LTS linux-gkeop

78 explicit affected versions

Ubuntu:22.04:LTS linux-nvidia-6.5

11 explicit affected versions

Ubuntu:22.04:LTS linux-realtime

1 explicit affected versions

Ubuntu:Pro:FIPS-updates:18.04:LTS linux-gcp-fips

69 explicit affected versions

Ubuntu:22.04:LTS linux-aws-6.8

14 explicit affected versions

03 / CONNECTIONS

Connected vulnerabilities

related USN-7276-1
related USN-7277-1

04 / EVIDENCE

Source records

Open Source Vulnerabilities UBUNTU-CVE-2024-50301

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.]

View original source

05 / REFERENCES

Further evidence