gecko-dev/security
Jed Davis 272d93bb18 Bug 1759196 - Fix the Linux sandbox's handling of 32-bit arguments on 64-bit platforms. r=gcp,bobowen
Background: When 32-bit types are passed in registers on x86-64 (and
probably other platforms?), the function call ABI does not specify the
contents of the upper half, and the Linux kernel syscall ABI appears to
have the same behavior.

In practice, the upper half is usually zero (or maybe sign-extended from
the lower half), because 64-bit operations aren't cheaper than 32-bit,
and 32-bit operations zero-extend their outputs; therefore, this case
usually doesn't happen in the first place, and any kind of spill or
register move will zero the upper half.  However, arbitrary values are
possible, and a case like this has occurred with the Firefox profiler
using `clock_gettime`.  (This paragraph is applicable to x86-64 and
ARM64; other 64-bit architecutures may behave differently.)

But the Chromium seccomp-bpf compiler, when testing the value of a 32-bit
argument on a 64-bit platform, requires that the value be zero-extended
or sign-extended, and (incorrectly, as far as I can tell) considers
anything else an ABI violation.

With this patch, when that case is detected, we use the `SIGSYS` handler
to zero-extend the problematic argument and re-issue the syscall.

(It would also be possible to just ignore the upper half, and that would
be faster, but that could lead to subtle security holes if the type
used in `bpf_dsl` is incorrect and the kernel really does treat it as
64-bit.)

Differential Revision: https://phabricator.services.mozilla.com/D143964
2022-04-22 02:00:51 +00:00
..
apps Bug 1088140 - support RSA-PSS signatures on certificates in the certificate verifier r=jschanck 2022-03-24 21:34:21 +00:00
certverifier Bug 1758652 - avoid creating CERTCertificates in IsCertBuiltInRoot, rework saving intermediates r=jschanck 2022-04-14 20:52:07 +00:00
ct Bug 1761511 - Part 5: Fix gtest deprecation warnings, r=ahal 2022-04-14 02:09:22 +00:00
mac/hardenedruntime
manager No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=diannaS 2022-04-21 11:42:29 +00:00
nss Bug 1758579 - land NSS NSS_3_77_RTM UPGRADE_NSS_RELEASE, r=djackson 2022-04-01 15:44:27 +00:00
rlbox Bug 1732201 - Sandbox woff2 in OTS using RLBox r=bholley 2021-11-27 23:30:49 +00:00
sandbox Bug 1759196 - Fix the Linux sandbox's handling of 32-bit arguments on 64-bit platforms. r=gcp,bobowen 2022-04-22 02:00:51 +00:00
.eslintrc.js
generate_certdata.py
generate_mapfile.py
moz.build Bug 1751367: Delay loading winmm.dll, so it loads after COM initialization. r=cmartin,media-playback-reviewers,alwu 2022-02-02 13:43:51 +00:00
nss.symbols