Commit 556fa9fd authored by Andy Grover's avatar Andy Grover

ACPI: Add access checking (Andi Kleen)

parent fa4aac5e
......@@ -38,6 +38,7 @@
#include <acpi/acpi.h>
#include <asm/io.h>
#include <acpi/acpi_bus.h>
#include <asm/uaccess.h>
#ifdef CONFIG_ACPI_EFI
#include <linux/efi.h>
......@@ -948,19 +949,22 @@ acpi_os_get_line(char *buffer)
return 0;
}
/*
* We just have to assume we're dealing with valid memory
*/
/* Assumes no unreadable holes inbetween */
BOOLEAN
acpi_os_readable(void *ptr, u32 len)
{
#if defined(__i386__) || defined(__x86_64__)
char tmp;
return !__get_user(tmp, (char *)ptr) && !__get_user(tmp, (char *)ptr + len - 1);
#endif
return 1;
}
BOOLEAN
acpi_os_writable(void *ptr, u32 len)
{
/* could do dummy write (racy) or a kernel page table lookup.
The later may be difficult at early boot when kmap doesn't work yet. */
return 1;
}
......
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