Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-48367

envp may be unreliable in global initializers

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.7.0, 4.4.13
    • Internal Code
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Service arch 2020-06-01, Service arch 2020-06-15, Service arch 2020-06-29
    • 50

    Description

      Hypothetical cause of BF-17563.

      We clone the envp we got from main(argv,argc,env) into the InitializerContext.
      I believe it may be corrupted by static initializers by the time main runs.
      We can use environ instead. A better fix would be to change idiom so that InitializerContext provides a getenv accessor instead of a full snapshot of the environment. Nobody should need to see everything in the environment, they can pick out the keys they're interested in one by one. That's safer than a snapshot.

      Attachments

        Issue Links

          Activity

            People

              billy.donahue@mongodb.com Billy Donahue
              billy.donahue@mongodb.com Billy Donahue
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: