Commit ab59c893 authored by Tony Luck's avatar Tony Luck Committed by Rafael J. Wysocki

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: default avatarTony Luck <tony.luck@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent a0909315
...@@ -549,6 +549,9 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, ...@@ -549,6 +549,9 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
!arch_is_platform_page(base_addr))) !arch_is_platform_page(base_addr)))
return -EINVAL; return -EINVAL;
if (is_zero_pfn(base_addr >> PAGE_SHIFT))
return -EADDRINUSE;
inject: inject:
mutex_lock(&einj_mutex); mutex_lock(&einj_mutex);
rc = __einj_error_inject(type, flags, param1, param2, param3, param4); rc = __einj_error_inject(type, flags, param1, param2, param3, param4);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment