[syslinux] [PATCH 0/2] Stack overflows when running commands

celelibi at gmail.com celelibi at gmail.com
Mon Oct 12 21:04:05 PDT 2015


From: Sylvain Gault <sylvain.gault at gmail.com>

Hello there,

I propose 2 patches that fix two possible stack overflows either when running a
COM32 module or when loading a new config file.

I didn't find a better way to do this than to use the infamous setjmp/longjmp
functions to restore the stack to a previous state. This makes the logic a bit
more complex, but the behavior is not changed.

Although these bugs are not very visible right now because of some useless
section in the binaries taking some space allowing the stack to overflow
without consequences, they might need to be fixed very soon.

Still remain a limitation when running a lot of commands (or loading lots of
time some config file) is that some files might not be closed and some memory
may not be freed.

Sylvain Gault (2):
  ldlinux: fix stack overflow when running COM32 modules
  core: Fix stack overflow when reloading config

 com32/elflink/ldlinux/execute.c |  4 ++-
 com32/elflink/ldlinux/ldlinux.c | 28 ++++++++++++++------
 core/elflink/load_env32.c       | 58 ++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 80 insertions(+), 10 deletions(-)

-- 
2.6.1



More information about the Syslinux mailing list