Closed Bug 1610570 Opened 6 years ago Closed 5 years ago

Support a 'passback' attribute for individual IPC arguments to avoid requiring no-op validations

Categories

(Core :: IPC, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: tjr, Assigned: tjr)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

In certain circumstances, the unprivileged process will provide a numeric identifier to the privileged process that serves as an internal bookkeeping record. The parent doesn't do anything with this parameter except return it to the child.

For example here, aPromiseID is just returned to the child.

It would be nicer if we could indicate this so there is no need to call MOZ_VALIDATE_AND_GET(foo, true) and indicate a justification somewhere.

We could put it on the argument where it comes from the unprivileged process, so it arrives in the privileged process without a Tainted<> indicator.

Or, we could put it on the argument where it is sent by the privileged process, so the caller is able to pass a Tainted<> directly instead of needing to perform a no-check validation.

I am more inclined to do the latter because (a) it means that validation would have to be performed if someone did want to use it for something and (b) it implicitly means that trying to pass a value that either didn't come from the child or was somehow computed (because it's a foo instead of Tainted<foo>) breaks.

As we look at more IPC methods we want to cut over, we can look for instances where that might break something legitimately.

Bikeshedding on the keyword welcome. Right now I'm imagining 'passthrough' or 'passback'.

Priority: -- → P3
Assignee: nobody → tom
Status: NEW → ASSIGNED

Depends on D108246

Pushed by tritter@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8d78b75b87fc Support the NoTaint attribute on method parameters with the passback value r=mccr8 https://hg.mozilla.org/integration/autoland/rev/6594ce800a6b Pass attributes through so lower.py can change code emission, and handle NoTaint r=mccr8 https://hg.mozilla.org/integration/autoland/rev/e2ef5d146d6a Apply the passback attribute to gamepad r=cmartin https://hg.mozilla.org/integration/autoland/rev/047120786a91 Add a 'NoTaint=allvalid' attribute as well, and cut Gamepad over to it r=cmartin
Pushed by tritter@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c7f732f443b1 Support the NoTaint attribute on method parameters with the passback value r=mccr8 https://hg.mozilla.org/integration/autoland/rev/83b086da2960 Pass attributes through so lower.py can change code emission, and handle NoTaint r=mccr8 https://hg.mozilla.org/integration/autoland/rev/ccc49e1fd15c Apply the passback attribute to gamepad r=cmartin https://hg.mozilla.org/integration/autoland/rev/faf6f57c64eb Add a 'NoTaint=allvalid' attribute as well, and cut Gamepad over to it r=cmartin
Pushed by tritter@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0ac29016e4ac Support the NoTaint attribute on method parameters with the passback value r=mccr8 https://hg.mozilla.org/integration/autoland/rev/9f428052118e Pass attributes through so lower.py can change code emission, and handle NoTaint r=mccr8 https://hg.mozilla.org/integration/autoland/rev/6545e385355e Apply the passback attribute to gamepad r=cmartin https://hg.mozilla.org/integration/autoland/rev/1fd580d39fcf Add a 'NoTaint=allvalid' attribute as well, and cut Gamepad over to it r=cmartin
Regressions: 1700595
Flags: needinfo?(tom)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: