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

Server parameters with AtomicWord<int> do not handle out of bound values gracefully

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.4
    • Affects Version/s: 4.2.3, 4.3.3
    • Component/s: Replication
    • None
    • Minor Change
    • ALL
    • Hide
      let rst = new ReplSetTest({nodes: 1});
      rst.startSet();
      rst.initiate();
      
      let primary = rst.getPrimary();
      assert.commandFailedWithCode(
          primary.adminCommand({setParameter: 1, oplogFetcherSteadyStateMaxFetcherRestarts: NaN}),
          ErrorCodes.BadValue);
      assert.commandFailedWithCode(
          primary.adminCommand({setParameter: 1, oplogFetcherInitialSyncMaxFetcherRestarts: NaN}),
          ErrorCodes.BadValue);
      rst.stopSet();
      
      Show
      let rst = new ReplSetTest({nodes: 1}); rst.startSet(); rst.initiate(); let primary = rst.getPrimary(); assert.commandFailedWithCode( primary.adminCommand({setParameter: 1, oplogFetcherSteadyStateMaxFetcherRestarts: NaN}), ErrorCodes.BadValue); assert.commandFailedWithCode( primary.adminCommand({setParameter: 1, oplogFetcherInitialSyncMaxFetcherRestarts: NaN}), ErrorCodes.BadValue); rst.stopSet();
    • Security 2020-02-24
    • 95

      Some server parameters are backed by an AtomicWord<int> type. These types do not gracefully handle input values outside the range of representable int values when we try to coerce the arguments here. Our undefined behavior builders manifest this as a runtime error when trying to set a parameter to NaN, for example. See the attached repro for a few examples of server parameters with this issue. This may be a general issue for any numeric server parameters that do not use a BSONElement::safeNumberLong deserializer.

            Assignee:
            sara.golemon@mongodb.com Sara Golemon
            Reporter:
            william.schultz@mongodb.com William Schultz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: