From be1dbd0302749cb4a21507055127ea183ebe3c1d Mon Sep 17 00:00:00 2001 From: Mian Yousaf Kaukab Date: Mon, 15 Apr 2019 16:21:21 -0500 Subject: [PATCH] BACKPORT: arm64: Add sysfs vulnerability show for spectre-v1 spectre-v1 has been mitigated and the mitigation is always active. Report this to userspace via sysfs This patch is backported from: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.3-rc1&id=3891ebccace188af075ce143d8b072b65e90f695 Signed-off-by: Mian Yousaf Kaukab Signed-off-by: Jeremy Linton Reviewed-by: Andre Przywara Reviewed-by: Catalin Marinas Tested-by: Stefan Wahren Acked-by: Suzuki K Poulose Signed-off-by: Will Deacon Signed-off-by: Khuong Dinh --- arch/arm64/kernel/cpu_errata.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index 538387ecf..e512c55d8 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -746,3 +746,9 @@ const struct arm64_cpu_capabilities arm64_errata[] = { { } }; + +ssize_t cpu_show_spectre_v1(struct device *dev, struct device_attribute *attr, + char *buf) +{ + return sprintf(buf, "Mitigation: __user pointer sanitization\n"); +}