Skip to content

Commit ab59c89

Browse files
aeglrafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent a090931 commit ab59c89

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/acpi/apei/einj.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,9 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
549549
!arch_is_platform_page(base_addr)))
550550
return -EINVAL;
551551

552+
if (is_zero_pfn(base_addr >> PAGE_SHIFT))
553+
return -EADDRINUSE;
554+
552555
inject:
553556
mutex_lock(&einj_mutex);
554557
rc = __einj_error_inject(type, flags, param1, param2, param3, param4);

0 commit comments

Comments
 (0)