dm ioctl: prevent potential spectre v1 gadget
stable inclusion from stable-v5.10.111 commit 71c8df33fd777c7628f6fbc09b14e84806c55914 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5GL1Z Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=71c8df33fd777c7628f6fbc09b14e84806c55914 -------------------------------- [ Upstream commit cd9c88da ] 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: NJordy Zomer <jordy@pwning.systems> Signed-off-by: NMike Snitzer <snitzer@redhat.com> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Reviewed-by: NWei Li <liwei391@huawei.com>
Showing
想要评论请 注册 或 登录