diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-10-21 11:47:47 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-10-21 11:47:47 +0200 |
commit | a8f1332f49206b314871fbdea50ab1045401a024 (patch) | |
tree | 62d03638f49f11b8d50754db721a35ae52f3f6f3 /translate.cxx | |
parent | 96c57a86bb8d14b49b2e8b0ab8e9a044b2fadf42 (diff) | |
parent | bc0b26aa958253192328bc4084ba367536fb4842 (diff) | |
download | systemtap-steved-a8f1332f49206b314871fbdea50ab1045401a024.tar.gz systemtap-steved-a8f1332f49206b314871fbdea50ab1045401a024.tar.xz systemtap-steved-a8f1332f49206b314871fbdea50ab1045401a024.zip |
Merge branch 'unwind_robust'
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/translate.cxx b/translate.cxx index bc5d6158..9d456bca 100644 --- a/translate.cxx +++ b/translate.cxx @@ -29,6 +29,11 @@ extern "C" { #include <elfutils/libdwfl.h> } +// Max unwind table size (debug or eh) per module. Somewhat arbitrary +// limit (a bit more than twice the .debug_frame size of my local +// vmlinux for 2.6.31.4-83.fc12.x86_64) +#define MAX_UNWIND_TABLE_SIZE (3 * 1024 * 1024) + using namespace std; struct var; @@ -4785,6 +4790,9 @@ dump_unwindsyms (Dwfl_Module *m, get_unwind_data (m, &debug_frame, &eh_frame, &debug_len, &eh_len, &eh_addr); if (debug_frame != NULL && debug_len > 0) { + if (debug_len > MAX_UNWIND_TABLE_SIZE) + throw semantic_error ("module debug unwind table size too big"); + c->output << "#if defined(STP_USE_DWARF_UNWINDER) && defined(STP_NEED_UNWIND_DATA)\n"; c->output << "static uint8_t _stp_module_" << stpmod_idx << "_debug_frame[] = \n"; @@ -4802,6 +4810,9 @@ dump_unwindsyms (Dwfl_Module *m, if (eh_frame != NULL && eh_len > 0) { + if (eh_len > MAX_UNWIND_TABLE_SIZE) + throw semantic_error ("module eh unwind table size too big"); + c->output << "#if defined(STP_USE_DWARF_UNWINDER) && defined(STP_NEED_UNWIND_DATA)\n"; c->output << "static uint8_t _stp_module_" << stpmod_idx << "_eh_frame[] = \n"; |