mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 02:01:36 +03:00
platform: nvadsp: prevent speculative load related leak
Data can be speculatively loaded from memory and stay in cache even when bound check fails. This can lead to unintended information disclosure via side-channel analysis. To mitigate this problem, use array_index_nospec. Bug 2060857 CVE-2017-5753 Change-Id: I3b79ab2df0cff5eb7f94f8056cfdfb98ac69037a Signed-off-by: David Gilhooley <dgilhooley@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1684649 Reviewed-by: Bo Yan <byan@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Laxman Dewangan
parent
c844c3a973
commit
d56b0972b0
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include "dev.h"
|
||||
#include <linux/nospec.h>
|
||||
#include <asm/barrier.h>
|
||||
|
||||
#define NVADSP_MAILBOX_START 512
|
||||
@@ -187,7 +188,9 @@ status_t nvadsp_mbox_open(struct nvadsp_mbox *mbox, uint16_t *mid,
|
||||
ret = -ERANGE;
|
||||
goto out;
|
||||
}
|
||||
speculation_barrier();
|
||||
|
||||
*mid = array_index_nospec(*mid, NVADSP_MAILBOX_MAX);
|
||||
|
||||
if (nvadsp_drv_data->mboxes[*mid]) {
|
||||
pr_debug("%s: mailbox %d already opened.\n",
|
||||
__func__, *mid);
|
||||
|
||||
Reference in New Issue
Block a user