Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-6216

LibeventSSLSocketImpl::create is not safe to call concurrently with os::getenv

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.0.2, 1.1.0
    • security
    • Mesosphere Sprint 44
    • 5

    Description

      LibeventSSLSocketImpl::create is called whenever a potentially ssl-enabled socket is created. It in turn calls openssl::initialize which calls a function reinitialize using os::setenv. Here os::setenv is used to set up SSL-related libprocess environment variables LIBPROCESS_SSL_*.

      Since os::setenv is not thread-safe just like the ::setenv it wraps, any calling of functions like os::getenv (or via os::environment) concurrently with the first invocation of LibeventSSLSocketImpl::create performs unsynchronized r/w access to the same data structure in the runtime.

      We usually perform most setup of the environment before we start the libprocess runtime with process::initialize from a main function, see e.g., src/slave/main.cpp or src/master/main.cpp and others. It appears that we should move the setup of libprocess' SSL environment variables to a similar spot.

      Attachments

        1. build.log
          47 kB
          Benjamin Bannier

        Issue Links

          Activity

            People

              bbannier Benjamin Bannier
              bbannier Benjamin Bannier
              Till Toenshoff Till Toenshoff
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: