diff options
author | Jan Beulich <jbeulich@novell.com> | 2006-12-06 20:14:13 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-12-06 20:14:13 -0500 |
commit | 359ad0d4015a9ab39243f2ebc4eb07915bd618b2 (patch) | |
tree | 90f05d8d9ab048029bfe1e451a012b4d5896aafe /include | |
parent | eef5e0d185fc049bda11fa14ba286fbd357da896 (diff) |
[PATCH] unwinder: more sanity checks in Dwarf2 unwinder
Tighten the requirements on both input to and output from the Dwarf2
unwinder.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-i386/unwind.h | 12 | ||||
-rw-r--r-- | include/asm-x86_64/unwind.h | 8 |
2 files changed, 6 insertions, 14 deletions
diff --git a/include/asm-i386/unwind.h b/include/asm-i386/unwind.h index 601fc67bd775..aa2c931e30db 100644 --- a/include/asm-i386/unwind.h +++ b/include/asm-i386/unwind.h | |||
@@ -79,17 +79,13 @@ extern asmlinkage int arch_unwind_init_running(struct unwind_frame_info *, | |||
79 | void *arg), | 79 | void *arg), |
80 | void *arg); | 80 | void *arg); |
81 | 81 | ||
82 | static inline int arch_unw_user_mode(const struct unwind_frame_info *info) | 82 | static inline int arch_unw_user_mode(/*const*/ struct unwind_frame_info *info) |
83 | { | 83 | { |
84 | #if 0 /* This can only work when selector register and EFLAGS saves/restores | 84 | return user_mode_vm(&info->regs) |
85 | are properly annotated (and tracked in UNW_REGISTER_INFO). */ | 85 | || info->regs.eip < PAGE_OFFSET |
86 | return user_mode_vm(&info->regs); | ||
87 | #else | ||
88 | return info->regs.eip < PAGE_OFFSET | ||
89 | || (info->regs.eip >= __fix_to_virt(FIX_VDSO) | 86 | || (info->regs.eip >= __fix_to_virt(FIX_VDSO) |
90 | && info->regs.eip < __fix_to_virt(FIX_VDSO) + PAGE_SIZE) | 87 | && info->regs.eip < __fix_to_virt(FIX_VDSO) + PAGE_SIZE) |
91 | || info->regs.esp < PAGE_OFFSET; | 88 | || info->regs.esp < PAGE_OFFSET; |
92 | #endif | ||
93 | } | 89 | } |
94 | 90 | ||
95 | #else | 91 | #else |
diff --git a/include/asm-x86_64/unwind.h b/include/asm-x86_64/unwind.h index 2e7ff10fd775..2f6349e48717 100644 --- a/include/asm-x86_64/unwind.h +++ b/include/asm-x86_64/unwind.h | |||
@@ -87,14 +87,10 @@ extern int arch_unwind_init_running(struct unwind_frame_info *, | |||
87 | 87 | ||
88 | static inline int arch_unw_user_mode(const struct unwind_frame_info *info) | 88 | static inline int arch_unw_user_mode(const struct unwind_frame_info *info) |
89 | { | 89 | { |
90 | #if 0 /* This can only work when selector register saves/restores | 90 | return user_mode(&info->regs) |
91 | are properly annotated (and tracked in UNW_REGISTER_INFO). */ | 91 | || (long)info->regs.rip >= 0 |
92 | return user_mode(&info->regs); | ||
93 | #else | ||
94 | return (long)info->regs.rip >= 0 | ||
95 | || (info->regs.rip >= VSYSCALL_START && info->regs.rip < VSYSCALL_END) | 92 | || (info->regs.rip >= VSYSCALL_START && info->regs.rip < VSYSCALL_END) |
96 | || (long)info->regs.rsp >= 0; | 93 | || (long)info->regs.rsp >= 0; |
97 | #endif | ||
98 | } | 94 | } |
99 | 95 | ||
100 | #else | 96 | #else |