Pointer to freed OperationContext is passed to Pipeline::dispose()

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Gone away
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • ALL
    • Query 2019-02-25
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      ClusterClientCursors have a ClusterClientCursorParams:

      Which has a PipelineDeleter:

      https://github.com/mongodb/mongo/blob/f9f33683b6ec5995091ee214c81d75c0ab163fe4/src/mongo/s/query/cluster_client_cursor_params.h#L126-L127

      Which has an OperationContext
      https://github.com/mongodb/mongo/blob/f9f33683b6ec5995091ee214c81d75c0ab163fe4/src/mongo/db/pipeline/pipeline.h#L428

      The _opCtx is not updated when the ClusterClientCursor is detached or reattached to an operation context.

      https://github.com/mongodb/mongo/blob/f9f33683b6ec5995091ee214c81d75c0ab163fe4/src/mongo/s/query/cluster_client_cursor_impl.cpp#L124-L132

      This could definitely be a use-after-free bug.

              Assignee:
              Anton Korshunov
              Reporter:
              Ian Boros
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: