Closed Bug 1141885 Opened 9 years ago Closed 9 years ago

Make readlink() fail instead of allowing it, for B2G content processes

Categories

(Core :: Security: Process Sandboxing, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: jld, Assigned: jld)

References

Details

Attachments

(1 file, 1 obsolete file)

We're currently letting B2G content processes call readlink(), because WebRTC wants to do crypto in the content process, and NSS can't do that without trying to load a PKCS#11 library, and that wants to use readlink (misuse, really; it looks like it will fail entertainingly if it ever encounters relative symlinks).  And for some reason we can't easily get rid of the PKCS#11 thing, which very much does not belong in a content process under any circumstance, if I correctly understand what it is.

But it's not actually going to encounter a symlink, at least not on B2G.  So we can just have readlink always fail with EINVAL.  Empirically, WebRTC still works with this change; I'll also run Try.

It will save me some work if I don't actually have to remote readlink() in bug 930258.
Comment on attachment 8576203 [details] [diff] [review]
bug1141885-fail-readlink-hg0.diff

Review of attachment 8576203 [details] [diff] [review]:
-----------------------------------------------------------------

more woohoo :)
Attachment #8576203 - Flags: review?(gdestuynder) → review+
Rebased (would conflict with bug 906996).  Carrying over r+.  Try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=374c094a84df

Also tested locally with an app that uses window.crypto.subtle.
Attachment #8576203 - Attachment is obsolete: true
Attachment #8577544 - Flags: review+
Try run in comment #3 seems to have passed as much as it can be expected to.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/093b0a844c3b
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: