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

Integer overflow in sharded find when maxTimeMS > 2M

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: 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

      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.

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

              Created:
              Updated:
              Resolved: