Improved safety for user memory accesses.
* Changed IS_USER_ADDRESS to check an address using USER_BASE and USER_SIZE, rather than just !IS_KERNEL_ADDRESS. The old check would allow user buffers to point into the physical memory map area. * Added an unmapped hole at the end of the bottom half of the address space which catches buffers that cross into the uncanonical address region. This also removes the need to check for uncanonical return addresses in the syscall handler, it is no longer possible for the return address to be uncanonical under normal circumstances. All cases in which the return address might be changed by the kernel are still handled via the IRET path.
This commit is contained in:
@@ -23,10 +23,10 @@
|
||||
#define USER_BASE 0x100000
|
||||
#define USER_BASE_ANY USER_BASE
|
||||
#define USER_SIZE (0x80000000 - (0x10000 + 0x100000))
|
||||
#define USER_TOP (USER_BASE + USER_SIZE)
|
||||
#define USER_TOP (USER_BASE + (USER_SIZE - 1))
|
||||
|
||||
#define KERNEL_USER_DATA_BASE 0x6fff0000
|
||||
#define USER_STACK_REGION 0x70000000
|
||||
#define USER_STACK_REGION_SIZE (USER_TOP - USER_STACK_REGION)
|
||||
#define USER_STACK_REGION_SIZE ((USER_TOP - USER_STACK_REGION) + 1)
|
||||
|
||||
#endif /* _KERNEL_ARCH_PPC_KERNEL_H */
|
||||
|
||||
Reference in New Issue
Block a user