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

Integer overflow in sharded find when maxTimeMS > 2M

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • ALL
    • Hide

      Run a find on a sharded collection with maxTimeMS >= 2,147,484 and with allowPartialResults set.

      Show
      Run a find on a sharded collection with maxTimeMS >= 2,147,484 and with allowPartialResults set.
    • QE 2023-02-06
    • 155

    Description

      In cluster_find.cpp an int32_t is multiplied by 1000, which can cause overflow:

      Microseconds{std::min(1000 * (*findCommand.getMaxTimeMS()) / 10, 100000)}
      

      This leads to a tassert failure.

      The offending line of code was introduced after 6.2 was released in this commit, so this bug is only present on master, not on any released version.

      Attachments

        Activity

          People

            steve.tarzia@mongodb.com Steve Tarzia
            steve.tarzia@mongodb.com Steve Tarzia
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: