From eb4f6fb91be878c1acd727d62abb600b77b631fd Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 19 Jan 2004 05:12:38 -0800 Subject: [PATCH] Fix statically declare FIXMAPs From: Anton Blanchard , me. Two uses of the FIXADDR_USER_START/END things are problematic: a) ppc64 wants the FIXADDR area to be at a different location on 32bit and 64bit tasks. On 32bit we want it just below 4GB but that gets in the way on 64bit. By putting both right at -(some small amount) we can also use some ppc tricks to get there real quickly (single instruction branches). b) We assume that FIXADDR_USER_START and FIXADDR_USER_END are constants. This breaks the UML build. Fixes: - Call it all gate. We currently have half the stuff called fixmap and the other gate, lets be consistent. - Create in_gate_area(), get_gate_vma() and use it in both places - Provide defaults for in_gate_area/get_gate_vma, allowing an arch to override it. (I used CONFIG_* but am open to better suggestions here) - The /proc/pid/maps vma wasnt marked readable but the get_user vma was. That sounds suspicious to me, they are now both the same VMA and so have the same (read,exec) permissions --- include/linux/mm.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'include/linux') diff --git a/include/linux/mm.h b/include/linux/mm.h index 42f5c2df91d1..3ecd3d633c5f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -642,5 +642,33 @@ kernel_map_pages(struct page *page, int numpages, int enable) } #endif +#ifndef CONFIG_ARCH_GATE_AREA +#ifdef AT_SYSINFO_EHDR +static inline int in_gate_area(struct task_struct *task, unsigned long addr) +{ + if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END)) + return 1; + else + return 0; +} + +extern struct vm_area_struct gate_vma; +static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk) +{ + return &gate_vma; +} +#else +static inline int in_gate_area(struct task_struct *task, unsigned long addr) +{ + return 0; +} + +static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk) +{ + return NULL; +} +#endif +#endif + #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */ -- cgit v1.2.3