Skip to contentSkip to conversation

CVE-2022-49122: dm ioctl: prevent potential spectre v1 gadget

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Feb 26, 2025

lore
Share & tools
lore
#0 lore raw

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

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

dm ioctl: prevent potential spectre v1 gadget

It appears like cmd could be a Spectre v1 gadget as it's supplied by a user and used as an array index. Prevent the contents of kernel memory from being leaked to userspace via speculative execution by using array_index_nospec.

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

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

	Fixed in 4.9.311 with commit 76c94651005f58885facf9c973007f5ea01ab01f
	Fixed in 4.14.276 with commit 58880025e3362024f6d8ea01cb0c7a5df6c84ba6
	Fixed in 4.19.238 with commit 7ae2c5b89da3cfaf856df880af27d3bb32a74b3d
	Fixed in 5.4.189 with commit 0320bac5801b31407200227173205d017488f140
	Fixed in 5.10.111 with commit 71c8df33fd777c7628f6fbc09b14e84806c55914
	Fixed in 5.15.34 with commit 02cc46f397eb3691c56affbd5073e54f7a82ac32
	Fixed in 5.16.20 with commit 44e6cb3ab177faae840bb2c1ebda9a2539876184
	Fixed in 5.17.3 with commit dd86064417de828ff2102ddc6049c829bf7585b4
	Fixed in 5.18 with commit cd9c88da171a62c4b0f1c70e50c75845969fbc18

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-49122

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:
drivers/md/dm-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/76c94651005f58885facf9c973007f5ea01ab01f
	https://git.kernel.org/stable/c/58880025e3362024f6d8ea01cb0c7a5df6c84ba6
	https://git.kernel.org/stable/c/7ae2c5b89da3cfaf856df880af27d3bb32a74b3d
	https://git.kernel.org/stable/c/0320bac5801b31407200227173205d017488f140
	https://git.kernel.org/stable/c/71c8df33fd777c7628f6fbc09b14e84806c55914
	https://git.kernel.org/stable/c/02cc46f397eb3691c56affbd5073e54f7a82ac32
	https://git.kernel.org/stable/c/44e6cb3ab177faae840bb2c1ebda9a2539876184
	https://git.kernel.org/stable/c/dd86064417de828ff2102ddc6049c829bf7585b4
	https://git.kernel.org/stable/c/cd9c88da171a62c4b0f1c70e50c75845969fbc18