Linux sandbox support for ARM and ARM64 (aarch64)
Categories
(Core :: Security: Process Sandboxing, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: jld, Assigned: jld)
References
(Blocks 1 open bug)
Details
Attachments
(9 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Over a long weekend last year I got the Linux sandbox working on 32-bit and 64-bit ARM (which are Tier 3 and Tier 2, respectively, so not “officially” supported like x86) and recently I finally got around to cleaning up the patches.
ARM Linux probably isn't a high priority for attacks, but it does see some use, and we mostly have code for it already. The largest source of code changes was actually Linux/arm64's removal of syscalls that were redundant (up to reordering arguments and inserting constant arguments) when it was created — including all of the non-at
filesystem syscalls, like open
vs. openat
.
Note that the 32-bit ARM Linux build is currently broken in the non-Android case due to bug 1526653 and bug 1663095; I have local workarounds that I've been testing with (similar to what Linux distributions have to do).
Also, I haven't tried running any automated tests; I've tested only basic browsing, and there's a limit to what I can test (e.g., I don't have anything with working GL acceleration).
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Chromium's Linux sandboxing code needs some architecture-specific files
for ARM and ARM64 that we don't currently include in our partial import.
These are copied from Chromium tag 81.0.4044.138 (matching the latest
import of the rest of security/sandbox/chromium) without changes.
Assignee | ||
Comment 2•4 years ago
|
||
Assignee | ||
Comment 3•4 years ago
|
||
We no longer use GConf (bug 1433685), so we can remove the sandbox rule
allowing it to call utime(). That syscall doesn't exist on ARM or ARM64,
so this rule would have to be ifdef'ed if it were re-added.
Assignee | ||
Comment 4•4 years ago
|
||
Not strictly part of ARM support, but worth committing, and in
particular printing the AT_*
flags in hex is helpful for matching them
against headers when *at
syscalls fail.
Assignee | ||
Comment 5•4 years ago
|
||
Linux/arm64 seems to exclude any syscalls that were redundant when it was
created (specifically, that can be implemented in terms of another by
inserting constant arguments), which includes all the of the non-at
filesystem syscalls --- for example, open
vs. openat
.
This patch rearranges ifdefs to handle that case; later patches will
fill in the currently unhandled syscalls in the at
-only side.
Assignee | ||
Comment 6•4 years ago
|
||
Linux/arm64 omits syscalls that can be implemented in terms of newer
syscalls by inserting constant arguments; this means that all of the
basic filesystem operations use the at
versions, like unlinkat
replacing both unlink
and rmdir
. We've supported some of them when
x86 libcs started using them, but there are several others we were
missing; this patch adds them.
Assignee | ||
Comment 7•4 years ago
|
||
In addition to e.g. lacking open
in favor of openat
, Linux/arm64
also removes a number of older syscalls along similar lines, like dup2
in favor of dup3
, and all variants of select
other than pselect6
.
Assignee | ||
Comment 8•4 years ago
|
||
The ABI on ARM64 requires 16-byte stack alignment, and that includes the
small temporary stack that exists only so that we can longjmp
off of
it in the child process after calling clone
.
Assignee | ||
Comment 9•4 years ago
|
||
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f949e70af6e7
https://hg.mozilla.org/mozilla-central/rev/fa07b7780af5
https://hg.mozilla.org/mozilla-central/rev/d91555bddbef
https://hg.mozilla.org/mozilla-central/rev/ce2a02153703
https://hg.mozilla.org/mozilla-central/rev/c625170a8755
https://hg.mozilla.org/mozilla-central/rev/0f72af1970ca
https://hg.mozilla.org/mozilla-central/rev/5cbea38d1301
https://hg.mozilla.org/mozilla-central/rev/44f258418d94
https://hg.mozilla.org/mozilla-central/rev/49e60e08ca4c
Description
•