CVE-2022-50080

tee: add overflow check in register_shm_helper()

MEDIUM
5.5
CVSS Score
Published: June 18, 2025 at 11:02 AM UTC
Updated: June 17, 2026 at 05:22 AM UTC
1 product affected across 1 vendorLinux Kernel

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
MEDIUM5.5
Exploit prediction
EPSS 0.3%

Description

In the Linux kernel, the following vulnerability has been resolved: tee: add overflow check in register_shm_helper() With special lengths supplied by user space, register_shm_helper() has an integer overflow when calculating the number of pages covered by a supplied user space memory region. This causes internal_get_user_pages_fast() a helper function of pin_user_pages_fast() to do a NULL pointer dereference: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010 Modules linked in: CPU: 1 PID: 173 Comm: optee_example_a Not tainted 5.19.0 #11 Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015 pc : internal_get_user_pages_fast+0x474/0xa80 Call trace: internal_get_user_pages_fast+0x474/0xa80 pin_user_pages_fast+0x24/0x4c register_shm_helper+0x194/0x330 tee_shm_register_user_buf+0x78/0x120 tee_ioctl+0xd0/0x11a0 __arm64_sys_ioctl+0xa8/0xec invoke_syscall+0x48/0x114 Fix this by adding an an explicit call to access_ok() in tee_shm_register_user_buf() to catch an invalid user space address early.

Affected

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

4.16 ≤ v < 4.19.2564.16 ≤ v < 5.10.1374.16 ≤ v < 5.15.624.16 ≤ v < 5.18.194.16 ≤ v < 5.19.34.16 ≤ v < 5.4.2114.16 ≤ v < 6.04.20 ≤ v < 5.4.2115.11 ≤ v < 5.15.625.16 ≤ v < 5.18.195.19 ≤ v < 5.19.35.5 ≤ v < 5.10.13733ddf12bcf5326b93bd604f50a7474a434a35f94.166.0 rc1
Vendor states this is fixed in 2f8e79a1a6128214cb9b205a9869341af5dfb16b (fixed)
Vendor states this is fixed in 573ae4f13f630d6660008f1974c0a8a29c30e18a (fixed)
Vendor states this is fixed in 578c349570d2a912401963783b36e0ec7a25c053 (fixed)
Vendor states this is fixed in 58c008d4d398f792ca67f35650610864725518fd (fixed)
Vendor states this is fixed in 965333345fe952cc7eebc8e3a565ffc709441af2 (fixed)
Vendor states this is fixed in b37e0f17653c00b586cdbcdf0dbca475358ecffd (fixed)
Vendor states this is fixed in c12f0e6126ad223806a365084e86370511654bf1 (fixed)
Vendor states this is fixed in 4.16 (unaffected)
Vendor states this is fixed in 4.19.256 (unaffected)
Vendor states this is fixed in 5.10.137 (unaffected)
Vendor states this is fixed in 5.15.62 (unaffected)
Vendor states this is fixed in 5.18.19 (unaffected)
Vendor states this is fixed in 5.19.3 (unaffected)
Vendor states this is fixed in 5.4.211 (unaffected)
Vendor states this is fixed in 6.0 (unaffected)

References (7)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/2f8e79a1a6128214cb9b205a9869341af5dfb16b
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/573ae4f13f630d6660008f1974c0a8a29c30e18a
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/578c349570d2a912401963783b36e0ec7a25c053
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/58c008d4d398f792ca67f35650610864725518fd
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/965333345fe952cc7eebc8e3a565ffc709441af2
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/b37e0f17653c00b586cdbcdf0dbca475358ecffd
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/c12f0e6126ad223806a365084e86370511654bf1

CVSS

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

Quick Info

StatusANALYZED
CWE
CWE-476

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