[SERVER-30933] Server crashes if "find" command receives UUID for namespace that doesn't exist Created: 02/Sep/17  Updated: 30/Oct/23  Resolved: 20/Sep/17

Status: Closed
Project: Core Server
Component/s: Querying, Storage
Affects Version/s: None
Fix Version/s: 3.6.0-rc0

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Maria van Keulen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

python buildscripts/resmoke.py repro_server30933.js

repro_server30933.js

assert.commandWorked(db.runCommand({find: UUID("c52a81a9-93fb-4cb7-a2a6-63d1517f2c4a")}));

Sprint: Storage 2017-10-02
Participants:
Linked BF Score: 0

 Description   

The changes from 4970898 as part of SERVER-29839 made it so the QueryRequest updates its _nss member by resolving the UUID to a NamespaceString using the UUIDCatalog. It additionally introduced an invariant() that the UUID would be found in the UUIDCatalog; however, given that the UUID is user-supplied data we should probably be using uassert() here instead.

void QueryRequest::refreshNSS(OperationContext* opCtx) {
    UUIDCatalog& catalog = UUIDCatalog::get(opCtx);
    if (_uuid) {
        invariant(catalog.lookupCollectionByUUID(_uuid.get()));
        _nss = catalog.lookupNSSByUUID(_uuid.get());
    }
    invariant(!_nss.isEmpty());
}



 Comments   
Comment by Githook User [ 20/Sep/17 ]

Author:

{'email': 'maria@mongodb.com', 'name': 'Maria van Keulen', 'username': 'mvankeulen94'}

Message: SERVER-30933 Change invariant to uassert for invalid uuid in queries
Branch: master
https://github.com/mongodb/mongo/commit/06e0893491b5f0babf7484ec1c4a6a68109aa081

Comment by Maria van Keulen [ 19/Sep/17 ]

Re-opening since the commit broke compile_all on Windows.

Comment by Githook User [ 19/Sep/17 ]

Author:

{'email': 'maria@mongodb.com', 'name': 'Maria van Keulen', 'username': 'mvankeulen94'}

Message: Revert "SERVER-30933 Change invariant to uassert for invalid uuid in queries"

This reverts commit 3eedd24bb8448e9a491a03d8eaa21999d4ea9405.
Branch: master
https://github.com/mongodb/mongo/commit/469e035efb09fe7c59579e00796d4f6d429fb434

Comment by Githook User [ 19/Sep/17 ]

Author:

{'username': 'mvankeulen94', 'name': 'Maria van Keulen', 'email': 'maria@mongodb.com'}

Message: SERVER-30933 Change invariant to uassert for invalid uuid in queries
Branch: master
https://github.com/mongodb/mongo/commit/3eedd24bb8448e9a491a03d8eaa21999d4ea9405

Generated at Thu Feb 08 04:25:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.