summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2024-10-17 15:09:02 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-01 01:58:25 +0100
commitcf2bb1bf03068504f5c216194df57c23ed0bed5a (patch)
tree27b7272e97f9f56daa63d08971c417bc1f19204f /include
parentbb0f943675a9cf1d6b13bd94a13b63a7063a6d36 (diff)
downloadlinux-cf2bb1bf03068504f5c216194df57c23ed0bed5a.tar.gz
linux-cf2bb1bf03068504f5c216194df57c23ed0bed5a.tar.bz2
linux-cf2bb1bf03068504f5c216194df57c23ed0bed5a.zip
cdrom: Avoid barrier_nospec() in cdrom_ioctl_media_changed()
[ Upstream commit b0bf1afde7c34698cf61422fa8ee60e690dc25c3 ] The barrier_nospec() after the array bounds check is overkill and painfully slow for arches which implement it. Furthermore, most arches don't implement it, so they remain exposed to Spectre v1 (which can affect pretty much any CPU with branch prediction). Instead, clamp the user pointer to a valid range so it's guaranteed to be a valid array index even when the bounds check mispredicts. Fixes: 8270cb10c068 ("cdrom: Fix spectre-v1 gadget") Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Link: https://lore.kernel.org/r/1d86f4d9d8fba68e5ca64cdeac2451b95a8bf872.1729202937.git.jpoimboe@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions