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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Gone away
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Querying
    • None
    • ALL
    • Query 2019-02-25

    Description

      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.

      Attachments

        Activity

          People

            anton.korshunov@mongodb.com Anton Korshunov
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: