[SERVER-57097] Text indexes with weights outside the range of representable values of type 'int' can cause undefined behaviour Created: 20/May/21  Updated: 29/Oct/23  Resolved: 26/May/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.0-rc1, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Steps To Reproduce:

Run this against a UBSAN built mongod.

(function() {
"use strict";
 
const coll = db.weights;
coll.drop();
 
assert.commandWorked(coll.insert({x: 1, port: 27017}));
assert.commandWorked(coll.createIndex({x: 'text'}, {weights: {port: 450000000000}}));
});

 

Sprint: Execution Team 2021-05-31
Participants:
Linked BF Score: 43

 Description   

The undefined behaviour sanitizer was trying to create text indexes with weights outside the range of representable values of 'int' here.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 03/Jun/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-57097 fix FTSSpec::fixSpec() to handle int values in weight values that are out of bounds

(cherry picked from commit 8e370ecd5f94b6c287084783c0ebe8c175a6993f)
Branch: v5.0
https://github.com/mongodb/mongo/commit/3c7f40429e8d4e31a165766b0648db20d98e83bc

Comment by Githook User [ 03/Jun/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-57097 clean up fts_index.js

(cherry picked from commit 36f39383c0eaca644e38160dcb6dc8d783bdc040)
Branch: v5.0
https://github.com/mongodb/mongo/commit/d2f979de3d9666996d01a6fe0ea8c87b1f857979

Comment by Githook User [ 26/May/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-57097 fix FTSSpec::fixSpec() to handle int values in weight values that are out of bounds
Branch: master
https://github.com/mongodb/mongo/commit/8e370ecd5f94b6c287084783c0ebe8c175a6993f

Comment by Githook User [ 25/May/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-57097 clean up fts_index.js
Branch: master
https://github.com/mongodb/mongo/commit/36f39383c0eaca644e38160dcb6dc8d783bdc040

Generated at Thu Feb 08 05:40:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.