]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm ioctl: prevent potential spectre v1 gadget
authorJordy Zomer <jordy@jordyzomer.github.io>
Sat, 29 Jan 2022 14:58:39 +0000 (15:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:06:42 +0000 (09:06 +0200)
commit76c94651005f58885facf9c973007f5ea01ab01f
tree5e6200a41ac1001740d3ae66911cdce25dbee256
parentffa0495a506d5edbd1b4ad45a2759bc080856695
dm ioctl: prevent potential spectre v1 gadget

[ Upstream commit cd9c88da171a62c4b0f1c70e50c75845969fbc18 ]

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.

Signed-off-by: Jordy Zomer <jordy@pwning.systems>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm-ioctl.c