Latent use after free in QueuedDataMessage()
Categories
(Core :: WebRTC: Networking, defect)
Tracking
()
People
(Reporter: mozillabugs, Assigned: pehrsons)
References
(Regression)
Details
(4 keywords, Whiteboard: [adv-main129-])
Attachments
(7 files, 1 obsolete file)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
QueuedDataMessage() (netwerk/sctp/datachannel/DataChannel.h) would cause uses after free if its defaulted move constructor or its defaulted move-assignment operator were used. They currently are not used, as FF still builds successfully when I change them to deleted.
From FIREFOX_124_0_2_RELEASE:
103: class QueuedDataMessage {
104: public:
105: QueuedDataMessage(uint16_t stream, uint32_t ppid, int flags, const void* data,
106: uint32_t length)
107: : mStream(stream), mPpid(ppid), mFlags(flags), mLength(length) {
108: mData = static_cast<uint8_t*>(moz_xmalloc((size_t)length)); // infallible
109: memcpy(mData, data, (size_t)length);
110: }
111: QueuedDataMessage(QueuedDataMessage&& other) = default;
112: QueuedDataMessage& operator=(QueuedDataMessage&& other) = default;
113: ~QueuedDataMessage() { free(mData); }
...
119: uint8_t* mData;
120: };
Updated•2 years ago
|
Updated•2 years ago
|
Comment 1•2 years ago
|
||
I'm not sure what the right rating for this is. Surely we should fix it, but presumably if we did start calling it, the UAF would get detected by ASan, so it would have to be some use we didn't test which doesn't seem too likely.
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Comment 2•2 years ago
|
||
Set release status flags based on info from the regressing bug 1862740
Updated•2 years ago
|
Comment 3•2 years ago
|
||
Set release status flags based on info from the regressing bug 1862740
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 4•2 years ago
|
||
| Assignee | ||
Comment 5•2 years ago
|
||
See C.22 at
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c22-make-default-operations-consistent
These are not needed so deleting them is simpler than implementing them.
| Assignee | ||
Comment 6•2 years ago
|
||
| Assignee | ||
Comment 7•2 years ago
|
||
| Assignee | ||
Comment 8•2 years ago
|
||
This is refering to C.20's:
Enforcement
(Not enforceable) While not enforceable, a good static analyzer can detect
patterns that indicate a possible improvement to meet this rule. For example,
a class with a (pointer, size) pair of members and a destructor that deletes
the pointer could probably be converted to a vector.
| Assignee | ||
Comment 9•2 years ago
|
||
| Assignee | ||
Comment 10•2 years ago
|
||
This is refering to C.20's:
Enforcement
(Not enforceable) While not enforceable, a good static analyzer can detect
patterns that indicate a possible improvement to meet this rule. For example,
a class with a (pointer, size) pair of members and a destructor that deletes
the pointer could probably be converted to a vector.
| Assignee | ||
Comment 11•2 years ago
|
||
Updated•2 years ago
|
Comment 12•2 years ago
|
||
Comment 13•2 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e7d0e9781f0b
https://hg.mozilla.org/mozilla-central/rev/03198220d900
https://hg.mozilla.org/mozilla-central/rev/58797638fb29
https://hg.mozilla.org/mozilla-central/rev/97f62907f179
https://hg.mozilla.org/mozilla-central/rev/aba58f0f46eb
https://hg.mozilla.org/mozilla-central/rev/b027447fbfdf
https://hg.mozilla.org/mozilla-central/rev/2e0a2fc356c1
Comment 14•2 years ago
|
||
The patch landed in nightly and beta is affected.
:pehrsons, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox128towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Description
•