# CVE-2022-50080: tee: add overflow check in register_shm_helper()

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.28%, higher than 13% of CVEs (2026-11-30)
- Published: 2025-06-18T11:02:23.003Z
- Modified: 2026-11-05T20:17:22.740Z
- Weaknesses: CWE-476
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

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

(As written by CVE List.)

## Affected

- Linux Linux: from 033ddf12bcf5326b93bd604f50a7474a434a35f9 before b37e0f17653c00b586cdbcdf0dbca475358ecffd; from 033ddf12bcf5326b93bd604f50a7474a434a35f9 before 965333345fe952cc7eebc8e3a565ffc709441af2; from 033ddf12bcf5326b93bd604f50a7474a434a35f9 before 578c349570d2a912401963783b36e0ec7a25c053; from 033ddf12bcf5326b93bd604f50a7474a434a35f9 before c12f0e6126ad223806a365084e86370511654bf1; from 033ddf12bcf5326b93bd604f50a7474a434a35f9 before 2f8e79a1a6128214cb9b205a9869341af5dfb16b; from 033ddf12bcf5326b93bd604f50a7474a434a35f9 before 58c008d4d398f792ca67f35650610864725518fd; from 033ddf12bcf5326b93bd604f50a7474a434a35f9 before 573ae4f13f630d6660008f1974c0a8a29c30e18a; 4.16 (not affected: before 4.16; from 4.19.256 up to 4.19.*; from 5.4.211 up to 5.4.*; from 5.10.137 up to 5.10.*; from 5.15.62 up to 5.15.*; from 5.18.19 up to 5.18.*; from 5.19.3 up to 5.19.*; from 6.0 up to *)
- linux linux_kernel: from 4.16 before 4.19.256; from 4.20 before 5.4.211; from 5.5 before 5.10.137; from 5.11 before 5.15.62; from 5.16 before 5.18.19; from 5.19 before 5.19.3; 6.0

## References

- <https://git.kernel.org/stable/c/b37e0f17653c00b586cdbcdf0dbca475358ecffd> (patch)
- <https://git.kernel.org/stable/c/965333345fe952cc7eebc8e3a565ffc709441af2> (patch)
- <https://git.kernel.org/stable/c/578c349570d2a912401963783b36e0ec7a25c053> (patch)
- <https://git.kernel.org/stable/c/c12f0e6126ad223806a365084e86370511654bf1> (patch)
- <https://git.kernel.org/stable/c/2f8e79a1a6128214cb9b205a9869341af5dfb16b> (patch)
- <https://git.kernel.org/stable/c/58c008d4d398f792ca67f35650610864725518fd> (patch)
- <https://git.kernel.org/stable/c/573ae4f13f630d6660008f1974c0a8a29c30e18a> (patch)

## Sources

- CVE List: [CVE-2022-50080](https://www.cve.org/CVERecord?id=CVE-2022-50080), CVE Terms of Use, modified 2026-11-05
- NVD: [CVE-2022-50080](https://nvd.nist.gov/vuln/detail/CVE-2022-50080), Public domain, modified 2026-11-05

---

Page: https://cve.day/CVE-2022-50080 · Whole record: https://cve.day/CVE-2022-50080.json · Rebuilt by cve.day 2026-11-25T22:58:21.044Z
