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

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

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

      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@mongodb.com Anton Korshunov
            Reporter:
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: