Skip to contentSkip to conversation

CVE-2022-49785: x86/sgx: Add overflow check in sgx_validate_offset_length()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message May 1, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

x86/sgx: Add overflow check in sgx_validate_offset_length()

sgx_validate_offset_length() function verifies "offset" and "length" arguments provided by userspace, but was missing an overflow check on their addition. Add it.

The Linux kernel CVE team has assigned CVE-2022-49785 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.11 with commit c6d26d370767fa227fc44b98a8bdad112efdf563 and fixed in 5.15.81 with commit 5277e3d633a5d4157987f4aff068caa55e36db19
	Issue introduced in 5.11 with commit c6d26d370767fa227fc44b98a8bdad112efdf563 and fixed in 6.0.10 with commit 3b1c10fb754b0b67165e3f055a4208e5ba26dc89
	Issue introduced in 5.11 with commit c6d26d370767fa227fc44b98a8bdad112efdf563 and fixed in 6.1 with commit f0861f49bd946ff94fce4f82509c45e167f63690

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2022-49785

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:

	arch/x86/kernel/cpu/sgx/ioctl.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/5277e3d633a5d4157987f4aff068caa55e36db19
	https://git.kernel.org/stable/c/3b1c10fb754b0b67165e3f055a4208e5ba26dc89
	https://git.kernel.org/stable/c/f0861f49bd946ff94fce4f82509c45e167f63690