Closed Bug 1658755 Opened 5 years ago Closed 4 years ago

add MOZ_LIST_FIND to IPC Tainting macros

Categories

(Core :: IPC, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: jewilde, Assigned: jewilde)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

MOZ_LIST_FIND or maybe MOZ_FIND_AND_VALIDATE would be useful for cases where we need to validate something by checking it against a list. (i.e. aControllerIdx in WindowsGamepad.cpp)

tjr recommended to me something like const Gamepad* gamepad = MOZ_LIST_FIND(pad, mGamepads, pad.mSuperIndex == aControlIdx);

We should workshop on the best way to implement this.

Pushed by jewilde@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/49e43292c047 Create MOZ_FIND_AND_VALIDATE Tainting validation macro; r=tjr,sg

Backed out changeset 49e43292c047 (bug 1658755) for HashFunctions.h failures.

Push with failures: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&fromchange=46f96d192bbde81b758d6bc0662aa07d2b37c9cc&searchStr=linux%2C18.04%2Cx64%2Casan%2Copt%2Ctest-linux1804-64-asan%2Fopt-gtest-1proc%2Cgtest&tochange=9efc8c8ea025f99396bf1f6d8178bb644b7d9733&selectedTaskRun=Sa_EA_iES7SIHXVZtm0n9A.0

Backout link: https://hg.mozilla.org/integration/autoland/rev/e64f0b3c81943c0415c91f022102620714773ba7

Failure log: https://treeherder.mozilla.org/logviewer?job_id=322084382&repo=autoland&lineNumber=2243

[task 2020-11-17T19:47:01.531Z] 19:47:01     INFO -  TEST-START | Tainting.moz_find_and_validate
[task 2020-11-17T19:47:01.531Z] 19:47:01     INFO -  =================================================================
[task 2020-11-17T19:47:01.531Z] 19:47:01    ERROR -  ==1433==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd19225481 at pc 0x7fbdc88b2c53 bp 0x7ffd19223fc0 sp 0x7ffd19223fb8
...
[task 2020-11-17T19:47:02.203Z] 19:47:02     INFO -  SUMMARY: AddressSanitizer: stack-buffer-overflow /builds/worker/workspace/obj-build/dist/include/mozilla/HashFunctions.h:253:19 in HashStringUntilZero<const unsigned char *>
...
Flags: needinfo?(jewilde)

Thanks Bogdan! I'll get it sorted out

Flags: needinfo?(jewilde)

https://treeherder.mozilla.org/jobs?repo=try&revision=87924807f7895c0959a34d7d512501e9a809005d I've got a green light from my latest try push, so I'm going to try to land this again with the fix.

Pushed by cbrindusan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/98fe8014c42b Create MOZ_FIND_AND_VALIDATE Tainting validation macro; r=tjr,sg
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: