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

Undefined behaviour in the ServerStatusSection constructor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.5.6
    • Fix Version/s: 3.5.7
    • Component/s: Internal Code
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Platforms 2017-05-08
    • Linked BF Score:
      0

      Description

      The constructor for ServerStatusSection calls a non-static method on the CmdServerStatus class. Depending on the order of construction of the different sections, this invocation may happen before CmdServerStatus has been constructed.

      This was discovered through UBSAN:

      src/mongo/db/commands/server_status.cpp:196:21: runtime error: member call on address 0x55555cfde1d8 which does not point to an object of type 'mongo::CmdServerStatus'
      0x55555cfde1d8: note: object has invalid vptr
       00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
                    ^~~~~~~~~~~~~~~~~~~~~~~
                    invalid vptr
      

      Since CmdServerStatus::_sections is static it doesn't need to be accessed through a non-static function.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: