summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2022-04-20 00:19:21 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-04-22 17:52:27 +0300
commitab59c89396c007c360b1a4d762732d1621ff5456 (patch)
treea8dda876419c7a5189c32ce64440075534869f2e /drivers/acpi
parenta090931524d03a4975c84b89a32210420d852313 (diff)
downloadlinux-ab59c89396c007c360b1a4d762732d1621ff5456.tar.xz
ACPI, APEI, EINJ: Refuse to inject into the zero page
Some validation tests dynamically inject errors into memory used by applications to check that the system can recover from a variety of poison consumption sceenarios. But sometimes the virtual address picked by these tests is mapped to the zero page. This causes additional unexpected machine checks as other processes that map the zero page also consume the poison. Disallow injection to the zero page. Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/apei/einj.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index 95cc2a9f3e05..d4326ec12d29 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -549,6 +549,9 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
!arch_is_platform_page(base_addr)))
return -EINVAL;
+ if (is_zero_pfn(base_addr >> PAGE_SHIFT))
+ return -EADDRINUSE;
+
inject:
mutex_lock(&einj_mutex);
rc = __einj_error_inject(type, flags, param1, param2, param3, param4);