Commit b0b49f2673f (x86, vdso: Remove compat vdso support) removed
the FIX_VDSO macro defining the vdso area.
This patch updates it to use the vdso pointer and size to define the area
instead.
Signed-off-by: Jeff Mahoney
---
arch/x86/include/asm/elf.h | 1 +
arch/x86/include/asm/unwind.h | 18 +++++++++++++++---
arch/x86/vdso/vdso32-setup.c | 2 +-
3 files changed, 17 insertions(+), 4 deletions(-)
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -76,6 +76,7 @@ typedef struct user_fxsr_struct elf_fpxr
#include
extern unsigned int vdso_enabled;
+extern unsigned int vdso32_size;
/*
* This is used to ensure we don't load something for the wrong architecture.
--- a/arch/x86/include/asm/unwind.h
+++ b/arch/x86/include/asm/unwind.h
@@ -66,7 +66,7 @@ struct unwind_frame_info
#else /* X86_32 */
-#include
+#include
#define FRAME_RETADDR_OFFSET 4
@@ -81,6 +81,19 @@ struct unwind_frame_info
PTREGS_INFO(di), \
PTREGS_INFO(ip)
+static inline bool is_vdso32_area(struct unwind_frame_info *info)
+{
+ unsigned long vdso_addr;
+
+ if (!info->task || !info->task->mm ||
+ !info->task->mm->context.vdso)
+ return false;
+
+ vdso_addr = (unsigned long)info->task->mm->context.vdso;
+
+ return info->regs.ip >= vdso_addr &&
+ info->regs.ip < vdso_addr + vdso32_size;
+}
#endif
#define UNW_DEFAULT_RA(raItem, dataAlign) \
@@ -141,8 +154,7 @@ static inline int arch_unw_user_mode(/*c
#else
return user_mode_vm(&info->regs)
|| info->regs.ip < PAGE_OFFSET
- || (info->regs.ip >= __fix_to_virt(FIX_VDSO)
- && info->regs.ip < __fix_to_virt(FIX_VDSO) + PAGE_SIZE)
+ || is_vdso32_area(info)
|| info->regs.sp < PAGE_OFFSET;
#endif
}
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -71,7 +71,7 @@ EXPORT_SYMBOL_GPL(vdso_enabled);
#endif
static struct page **vdso32_pages;
-static unsigned vdso32_size;
+unsigned int vdso32_size;
#ifdef CONFIG_X86_64
--
Jeff Mahoney
SUSE Labs
--
To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org
To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org