[SERVER-2557] in mmap_posix, failed map() followed by close() may result in attempt to close an invalid handle Created: 15/Feb/11  Updated: 12/Jul/16  Resolved: 03/Mar/11

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 1.9.0

Type: Improvement Priority: Minor - P4
Reporter: Aaron Staple Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

In MemoryMappedFile::map(), fd is assigned to ::open() but is not reset to zero if ::open() fails. This can result in an attempt to close an invalid file handle in MemoryMappedFile::close(). Not necessarily a problem, but if we are doing any syscall auditing or if we check the return value of ::close at some point (which wouldn't be a bad idea) we will notice failures.



 Comments   
Comment by auto [ 02/Mar/11 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: Return MemoryMappedFile to unopened state if open fails SERVER-2557
https://github.com/mongodb/mongo/commit/79c994ddd814e7ebed53c3b600e2b268cf36fbec

Generated at Thu Feb 08 03:00:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.