From d02624bbaf9e4fb9b75dca83bcbd8bb8b2965bf6 Mon Sep 17 00:00:00 2001 From: RageLtMan Date: Mon, 28 Oct 2019 23:52:43 -0400 Subject: [PATCH] valid_mmap_phys_addr_range conflicts with upstream PaX implements valid_mmap_phys_addr_range in the kernel, and the (return 1) hack in chipsec_km.c has a name collision with it. Add another conditional for exposing the definition predicated on whether __HAVE_ARCH_PAX_OPEN_USERLAND is defined in the kernel headers. If it is, dont redefine the original function. --- drivers/linux/chipsec_km.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/linux/chipsec_km.c b/drivers/linux/chipsec_km.c index 8e1c1238..ecdb2a12 100644 --- a/drivers/linux/chipsec_km.c +++ b/drivers/linux/chipsec_km.c @@ -547,7 +547,7 @@ int __weak phys_mem_access_prot_allowed(struct file *file, return 1; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,12) && defined(ARCH_HAS_VALID_PHYS_ADDR_RANGE) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,12) && defined(ARCH_HAS_VALID_PHYS_ADDR_RANGE) && !defined(__HAVE_ARCH_PAX_OPEN_USERLAND) int valid_mmap_phys_addr_range(unsigned long pfn, size_t size) { return 1;