Commit 0aaccf1e authored by Lalithambika Krishnakumar's avatar Lalithambika Krishnakumar Committed by Zheng Zengkai
Browse files

nvme: avoid possible double fetch in handling CQE

stable inclusion
from stable-5.10.9
commit 74310d40e0a41483dc7125347a9ccc249655fd85
bugzilla: 47457

--------------------------------

[ Upstream commit 62df8016 ]

While handling the completion queue, keep a local copy of the command id
from the DMA-accessible completion entry. This silences a time-of-check
to time-of-use (TOCTOU) warning from KF/x[1], with respect to a
Thunderclap[2] vulnerability analysis. The double-read impact appears
benign.

There may be a theoretical window for @command_id to be used as an
adversary-controlled array-index-value for mounting a speculative
execution attack, but that mitigation is saved for a potential follow-on.
A man-in-the-middle attack on the data payload is out of scope for this
analysis and is hopefully mitigated by filesystem integrity mechanisms.

[1] https://github.com/intel/kernel-fuzzer-for-xen-project
[2] http://thunderclap.io/thunderclap-paper-ndss2019.pdf


Signed-off-by: default avatarLalithambika Krishna Kumar <lalithambika.krishnakumar@intel.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent c2ff532d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment