[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 |