Children of the init

Don't feed the geek!
  • Home
  • Imprint / Impressum

Weird libssh deadlock / heap corruption 0 : 1 stkn

Published by stkn on November 26, 2008 11:17 pm under FreeSWITCH

Long story short: both, apr and libssh have a function called “sha1_init” and of course, the runtime linker deceided to use the one contained in libfreeswitch.so instead of the (right) one from mod_ssh.so (libssh) resulting in a corrupted heap after calling it (even destroying some data used by the memory allocator in glibc, hence the deadlock in free).

Thing that saved the day: GCC Visibility support (hooray for marking all internal functions hidden)

And GDB command scripts are a wonderful thing (even if there are some bugs):

set pagination off
break buffer.c:buffer_free
commands
    print *buffer
    continue
end

With that obstacle out of the way it was fairly easy to get mod_ssh to do something a bit more useful…

The current code is in the git repository, it’s still not useable but moving in the right direction. The configure script works with GCC and SUN’s compiler, visibility support is a must though (>= GCC-4.0; SunStudio 12 / Express from July 2008 or newer).

No Comment

Comments are closed.

Posting your comment.

  • Categories

    • Development (39)
      • FreeSWITCH (23)
      • FreeTDM (2)
      • OpenZAP (9)
    • Hardware (1)
    • Misc (2)
  • Pages

    • About
    • Imprint / Impressum
  • Archives

    • January 2011
    • November 2010
    • June 2010
    • February 2010
    • January 2010
    • December 2009
    • October 2009
    • August 2009
    • July 2009
    • June 2009
    • April 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • March 2008
    • January 2008
    • November 2007
  • Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org

Copyright © 2022 Children of the init
WordPress Theme based on Light Theme