Multiple ASAN failure reports in comm/mailnews/mime (mimeenc.cpp:162:12, mimeenc.cpp:287:12, mimeenc.cpp:489:18, mimepbuf.cpp:207:14)
Categories
(MailNews Core :: MIME, defect)
Tracking
(thunderbird_esr128 affected, thunderbird132 fixed)
People
(Reporter: KaiE, Assigned: KaiE)
References
Details
(Whiteboard: [When backporting to 128 include bug 1927290])
Attachments
(5 files)
48 bytes,
text/x-phabricator-request
|
corey
:
approval-comm-beta+
KaiE
:
approval-comm-esr128?
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
corey
:
approval-comm-beta+
KaiE
:
approval-comm-esr128?
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
corey
:
approval-comm-beta+
KaiE
:
approval-comm-esr128?
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
corey
:
approval-comm-beta+
KaiE
:
approval-comm-esr128?
|
Details | Review |
142.41 KB,
patch
|
Details | Diff | Splinter Review |
After fixing bug 1852662, the ASAN UndefinedBehaviorSanitizer reports multiple additional failures.
The root cause of these issues is:
Our MIME C code uses an untyped void* in various places, but some functions use an explicit typed parameter.
We could potentially fix this new ASAN warning simply by changing those functions to also take a void* paramter, and do an optimistic type cast.
But I think this is against the idea of these checks. We shouldn't fix type checking by forcing parameters to be untyped, and then perform risky downcasting.
My suggestion is that we change the void* for all the "closure" parameters to a lightweight wrapper type, which can be passed around as a parameter (without requiring allocation).
The wrapper should transport which type of parameter we're transporting. That allows our casting functions to perform a check for the expected type, and safely abort on failure (instead of potentially crashing).
Assignee | ||
Comment 1•2 months ago
|
||
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•1 months ago
|
Updated•1 months ago
|
Assignee | ||
Updated•1 month ago
|
Updated•1 month ago
|
Assignee | ||
Comment 2•1 month ago
|
||
Assignee | ||
Comment 3•1 month ago
|
||
Comment 4•1 month ago
|
||
Will this also impact 128?
Assignee | ||
Comment 5•1 month ago
|
||
Yes, I think we should uplift these fixes to 128.
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Assignee | ||
Comment 6•1 month ago
•
|
||
The patch here depends on the following two commits from bug 1915397,
if you don't apply them (on esr128), you get merge issues.
https://hg.mozilla.org/comm-central/rev/c306f1b7067d
https://hg.mozilla.org/comm-central/rev/306a51c14688
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Comment 7•1 month ago
|
||
Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/a9a403a53dcc
Type checking for an initial set of closure parameters in C MIME code. r=mkmelin
https://hg.mozilla.org/comm-central/rev/3fdd12e6840c
Type checking for data_object in C MIME code. r=BenC
https://hg.mozilla.org/comm-central/rev/2f426872727b
Type checking for output and image closure parameters in C MIME code. r=mkmelin
https://hg.mozilla.org/comm-central/rev/b492a2fe9f56
Use smarter logic to avoid code repetition. r=BenC
Updated•1 month ago
|
Assignee | ||
Comment 9•1 month ago
|
||
Comment on attachment 9425307 [details]
Bug 1919290 - Type checking for an initial set of closure parameters in C MIME code. r=mkmelin
[Approval Request Comment]
Regression caused by (bug #): no
User impact if declined: these patches improve correctness and could potentially reduce risk for crashes
Testing completed (on c-c, etc.): should have no functional changes for the user
Risk to taking this patch (and alternatives if risky): small risk for accidental change in behavior of processing messages
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Comment 10•1 month ago
|
||
Note that the 4th patch undoes some of the earlier changes, and modifies them to shorter code. I will attach a patch FYI, that shows that the change is smaller.
Assignee | ||
Comment 11•1 month ago
|
||
Assignee | ||
Comment 12•1 month ago
|
||
Comment on attachment 9425307 [details]
Bug 1919290 - Type checking for an initial set of closure parameters in C MIME code. r=mkmelin
Let's wait a little longer with 128. I realize we'll also need bug 1852662, which got a follow-up bug 1921950, which I'd like to investigate first.
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Updated•1 month ago
|
Comment 13•29 days ago
|
||
Comment on attachment 9425307 [details]
Bug 1919290 - Type checking for an initial set of closure parameters in C MIME code. r=mkmelin
[Triage Comment]
Approved for beta
There are 4 patches in total
Comment 14•29 days ago
|
||
Comment on attachment 9426423 [details]
Bug 1919290 - Type checking for data_object in C MIME code. r=BenC
[Triage Comment]
Approved for beta
Comment 15•29 days ago
|
||
Comment on attachment 9426424 [details]
Bug 1919290 - Type checking for output and image closure parameters in C MIME code. r=mkmelin
[Triage Comment]
Approved for beta
Comment 16•29 days ago
|
||
Comment on attachment 9428172 [details]
Bug 1919290 - Use smarter logic to avoid code repetition. r=BenC
[Triage Comment]
Approved for beta
Comment 17•29 days ago
•
|
||
bugherder uplift |
Thunderbird 132.0b2:
https://hg.mozilla.org/releases/comm-beta/rev/cd03b92cd21d
https://hg.mozilla.org/releases/comm-beta/rev/84b51acb9365
https://hg.mozilla.org/releases/comm-beta/rev/6ca6b16fb214
https://hg.mozilla.org/releases/comm-beta/rev/7e42c05308f4
Updated•29 days ago
|
Assignee | ||
Comment 18•10 days ago
|
||
Comment on attachment 9425307 [details]
Bug 1919290 - Type checking for an initial set of closure parameters in C MIME code. r=mkmelin
[Approval Request Comment]
see comment 9
Assignee | ||
Updated•10 days ago
|
Assignee | ||
Updated•10 days ago
|
Assignee | ||
Updated•10 days ago
|
Assignee | ||
Comment 19•10 days ago
|
||
Given the size of this bug and related bug 1919290, you could consider postponing to a 128.4.1 release (not 128.4.0).
Assignee | ||
Comment 20•10 days ago
|
||
All 4 patches applies cleanly on comm-esr128 for me, please ping me if you have any merge issues, and I'll upload mine.
Assignee | ||
Comment 21•10 days ago
|
||
Let's postpone until we have more clarify around 1925085, there are some overlaps in patches, let's avoid merging trouble for now.
Assignee | ||
Updated•3 days ago
|
Description
•