Commit Graph

171 Commits

Author SHA1 Message Date
Benjamin Smedberg
acbeca42d6 Bug 1332639 - Fix nsBrowserApp.cpp and related headers to compile without the external string API, r=glandium
MozReview-Commit-ID: CQjtpA2lxAM
2017-02-27 13:39:34 -05:00
David Parks
b0304bb1c8 Bug 1284897 - Add mechanism to libsandbox_s to track names of files that have been given special sandbox access permissions (PermissionsService). r=bobowen, r=glandium
Hook this into the browser via the XREAppData. This patch does not include the changes to Chromium source code.
2017-02-14 15:08:40 -08:00
Sebastian Hengst
736fb3a64b Backed out changeset 71b9ac06a60a (bug 1284897) 2017-02-21 23:13:29 +01:00
David Parks
a8f0f4ecaf Bug 1284897 - Add mechanism to libsandbox_s to track names of files that have been given special sandbox access permissions (PermissionsService). r=bobowen, r=glandium
Hook this into the browser via the XREAppData. This patch does not include the changes to Chromium source code.
2017-02-14 15:08:40 -08:00
Phil Ringnalda
f72d4e4b61 Backed out 5 changesets (bug 1284897) for mozilla::SandboxPermissions::RemovePermissionsForProcess crashes
Backed out changeset 19b2fcee13a9 (bug 1284897)
Backed out changeset a5171791437f (bug 1284897)
Backed out changeset 3ea8b8a18515 (bug 1284897)
Backed out changeset 21497a4e3bde (bug 1284897)
Backed out changeset 12e17d5f0fa9 (bug 1284897)
2017-02-16 22:14:15 -08:00
David Parks
2ad604aab3 Bug 1284897 - Add mechanism to libsandbox_s to track names of files that have been given special sandbox access permissions (PermissionsService). r=bobowen, r=glandium
Hook this into the browser via the XREAppData. This patch does not include the changes to Chromium source code.
2017-02-14 15:08:40 -08:00
Mike Hommey
672182dcc9 Bug 1332523 - Add BinaryPath::Get variant that returns a UniquePtr instead of filling a stack buffer. r=bsmedberg 2017-01-13 09:40:54 +09:00
Mike Hommey
46f514d8b8 Bug 1332523 - Make GetBootstrap take the path to an arbitrary file next to libxul. r=bsmedberg
The FileExists check can be removed because the code loading the library
will handle that case already.
2017-01-13 09:27:39 +09:00
Mike Hommey
e8fdec5f55 Bug 1332523 - Remove nsXPCOMGlue.h. r=bsmedberg 2017-01-13 07:56:05 +09:00
Mike Hommey
853c307fdf Bug 1332523 - Move message indicating when the blocklist is initialized after user32.dll was loaded to the blocklist itself. r=dmajor 2017-01-12 11:13:40 +09:00
Mike Hommey
e521d08008 Bug 1330533 - Use FuzzerDriver directly instead of wrapping it in a libfuzzer_main function. r=decoder
Going further from the previous changes, all libfuzzer_main really does
is call the init function, and then proceed to call the fuzzer driver
with the testing function.

So instead of calling that function for it to do all that, the
LibFuzzerRunner can just call the init function itself, and then
call the fuzzer driver with the testing function.
2017-01-12 14:44:18 +09:00
Mike Hommey
688aecac16 Bug 1330533 - Pass LibFuzzerInitFunc and LibFuzzerTestingFunc to libfuzzer_main. r=decoder
The LibFuzzerRunner code lives in libxul. It's unnecessary complications
to have it call back a function in the firefox executable just so that
it calls another function that is in libxul. Passing the init and
testing functions to the libfuzzer_main function allows to just bypass
that roundtrip, simplifying the setup.
2017-01-12 14:50:14 +09:00
Mike Hommey
e55bae1e11 Bug 1330533 - Remove argc/argv arguments to XRE_LibFuzzerSetMain. r=decoder
The function given to XRE_LibFuzzerSetMain is called from somewhere that
does have access to argc/argv already, so we can avoid passing them
to XRE_LibFuzzerSetMain.

This actually might fix subtle issues with argc/argv not really matching
reality when calling the LibFuzzerMain function in the current code:
some arguments are handled before the call, and both argc and argv are
modified from within XRE_main, but the values stored for the
LibFuzzerMain call still are the original ones.

Argv being a pointer, and it not being reallocated, the value stored for
the LibFuzzerMain call points to the changed one, but argc, being an
integer, is not modified accordingly.

In fact, it's actually worse, because while the Gecko code doesn't
reallocate argv, gtk_main might. So if some GTK flag is passed on the
command line, there's also a possibility that the LibFuzzerMain function
will do a use-after-free.

So all in all, it's just better to use the set of modified argc/argv
from XRE_main instead of storing them from main().
2017-01-12 11:59:37 +09:00
Mike Hommey
3349e52d3c Bug 1306327 - Move reading application.ini to XRE_main. r=bsmedberg
Reading application.ini involves using nsCOMPtr<nsIFile>, and that can
only happen through the XPCOM glue, which we eventually want to get rid
of.

So, while keeping the command line argument/environment variable
handling in nsBrowserApp, we move the actually parsing of the file to
XRE_main, where things can be handled without the XPCOM glue.
2017-01-10 16:43:23 +09:00
Mike Hommey
b365aff82e Bug 1306327 - Use the new XRE Bootstrap API in Desktop Firefox. r=bsmedberg
This just wraps all the XRE method calls to go through the Bootstrap API
instead of relying on the XPCOM glue methods.
2016-12-16 11:10:02 +09:00
Mike Hommey
2756f99622 Bug 1306327 - Remove NS_XRE_DLL_BLOCKLIST_ENABLED. r=bsmedberg
Instead of having nsBrowserApp.cpp set a flag in XREAppData to indicate
whether the DLL blocklist properly initialized, just have XRE code ask
the blocklist itself.
2017-01-10 09:10:36 +09:00
Mike Hommey
f89620bd8c Bug 1306327 - Remove the flags argument to XRE_main. r=bsmedberg
This hasn't been used since the removal of the Metro code in bug
1039866, close to two years ago.
2017-01-10 14:15:50 +09:00
Mike Hommey
31e59dce13 Bug 1306327 - Don't set XREAppData.xreDirectory from nsBrowserApp.cpp. r=bsmedberg
It turns out nsAppRunner.cpp sets it to the exact same thing when it's
not already set, so we might as well use that.
2017-01-10 08:02:43 +09:00
Mike Hommey
772b6a862b Bug 1306327 - Remove XPCOMGlueEnablePreload. r=froydnj
Back in bug 632404, when the function was added, preloading was
conditional. But after some A/B testing, the conclusion in bug 771745
was that we would just do preloading unconditionally.

Which means in practice, we don't need to have a function to enable it
manually anymore, since we're always enabling it.
2016-12-15 17:37:53 +09:00
Jed Davis
c8328263a0 Bug 1277968 - Use firefox -contentproc on sandbox-enabled Linux. r=ted
MozReview-Commit-ID: 7izy7UvJpwS
2016-11-08 15:06:36 -07:00
Benjamin Smedberg
d8e6df4128 Bug 1321593 part B - Unify the startup path between firefox --app and normal Firefox startup. With fixup to properly release/not-leak xreDirectory r=glandium 2016-12-13 09:15:31 -05:00
Benjamin Smedberg
16afdb2402 Bug 1321593 part A - Refactor nsXREAppData: 1) make nsXREAppData strongly own its members 2) rename it to mozilla::XREAppData 3) separate out the static compiled data into StaticXREAppData 4) Remove XRE_CreateAppData and XRE_FreeAppData 5) remove the struct size and related size-checking code which was only ever useful for cross-version compatibility, r=glandium
MozReview-Commit-ID: CQv1UrSaw4D
2016-12-02 09:07:24 -05:00
Sebastian Hengst
960f717144 Backed out changeset eae2252a519f (bug 1321593) for leaks, e.g. in clipboard and jetpack tests. r=backout 2016-12-12 22:10:17 +01:00
Sebastian Hengst
3bcae5a727 Backed out changeset e531af57cd60 (bug 1321593) 2016-12-12 22:09:40 +01:00
Benjamin Smedberg
498732cb32 Bug 1321593 part B - Unify the startup path between firefox --app and normal Firefox startup, r=glandium
MozReview-Commit-ID: E6m3eWrX3aB
2016-12-02 09:08:01 -05:00
Benjamin Smedberg
3963121e97 Bug 1321593 part A - Refactor nsXREAppData: 1) make nsXREAppData strongly own its members 2) rename it to mozilla::XREAppData 3) separate out the static compiled data into StaticXREAppData 4) Remove XRE_CreateAppData and XRE_FreeAppData 5) remove the struct size and related size-checking code which was only ever useful for cross-version compatibility, r=glandium
MozReview-Commit-ID: CQv1UrSaw4D
2016-12-02 09:07:24 -05:00
Henri Sivonen
9c7d79ca9d Bug 1300843 - Print an error on 32-bit Linux in the absence of SSE2. r=glandium.
MozReview-Commit-ID: EEmAhXaeDeX
2016-09-14 12:40:53 +03:00
Tom Schuster
1b6fc2bed7 Bug 1302163 - Change code to use SprintfLiteral instead of snprintf. r=ehsan 2016-10-04 17:57:51 +02:00
Christian Holler (:decoder)
0ee2e05a6f Bug 1289194 - Experimental LibFuzzer integration. r=glandium
MozReview-Commit-ID: 9njDcbltyow
2016-09-01 15:07:01 +02:00
Jorg K
414f56691b Bug 1301987 - removed unused io.h and fcntl.h. r=jimm 2016-09-12 13:04:39 -07:00
Sebastian Hengst
cda67b5d84 Backed out changeset 95e68b473e91 (bug 1289194) for failure to process moz.build file. r=backout a=backout
MozReview-Commit-ID: GhfzNoiE808
2016-09-07 18:45:40 +02:00
Christian Holler (:decoder)
09deaa21d9 Bug 1289194 - Experimental LibFuzzer integration. r=glandium 2016-09-01 15:07:01 +02:00
Jim Mathies
fb8b02acac Bug 1286306 - Add an app info property exposing the state of the Windows dll blocklist, and test the value during browser test runs. r=bsmedberg
MozReview-Commit-ID: H7206wTh8YM
2016-07-27 15:20:58 -05:00
Aaron Klotz
d6375a0a0f Bug 1285356: Fix blocklist initialization regressions; r=bsmedberg
MozReview-Commit-ID: AlWyzVhtPLL
2016-07-07 17:00:23 -06:00
Eric Rahm
a9769642d5 Bug 1282980 - Remove MacQuirks. r=jrmuizel
MacQuirks was targeted for OSX from 10.6.8 up to but not including 10.7.0. We
have now removed support for 10.6 so we can safely remove this code. This also
fixes bug 1282184 where DMD is apparently choking on memory allocated in the
interpose library.
2016-07-19 23:48:29 -07:00
Makoto Kato
e28a8d5d84 Backed out changeset d6523dfaab78 (bug 1282980) due to OSX build failure
MozReview-Commit-ID: 9ZSylYsKDjp
2016-07-20 11:03:57 +09:00
Eric Rahm
7f5c0da102 Bug 1282980 - Remove MacQuirks. r=jrmuizel
MacQuirks was targeted for OSX from 10.6.8 up to but not including 10.7.0. We
have now removed support for 10.6 so we can safely remove this code. This also
fixes bug 1282184 where DMD is apparently choking on memory allocated in the
interpose library.
2016-07-19 16:49:24 -07:00
Chris Peterson
9591260fc7 Bug 1277155 - Part 1: Remove snprintf() polyfills for VS2013 in Sprintf.h and #defines. r=froydnj r=mhowell 2016-06-27 20:45:03 -07:00
Andrea Marchesini
7b077db3d2 Bug 1281793 - Remove some non-used telemetry IDs - part 1 - expired keys in nsBrowserApp, r=gfritzsche 2016-06-28 19:29:09 +02:00
Carsten "Tomcat" Book
6ec8837325 Backed out changeset e1001d232f8a (bug 1281793) for bustage on a CLOSED TREE 2016-06-28 17:05:04 +02:00
Andrea Marchesini
7bf5a197c2 Bug 1281793 - Remove some non-used telemetry IDs - part 1 - expired keys in nsBrowserApp, r=gfritzsche 2016-06-28 16:44:42 +02:00
Mike Hommey
04d312f0af Bug 1271574 - Purposefully leak the XUL_APP_FILE string passed to putenv. r=bsmedberg
Before bug 552864, the string was created with PR_smprintf, and
PR_SetEnv'ed (which, under the hood, just calls putenv). PR_smprintf was
allocating the string on the heap. Now, it's allocated on the stack, and
still putenv'ed.

putenv kind of takes ownership of the strings it's being passed, so
stack allocated strings are dangerous to use. It looks like we've been
fairly lucky that it worked, presumably because compilers would keep the
stack frame with the variable, but that's not guaranteed to happen, and
in some case, doesn't.

So we strdup the string and purposefully leak it instead, which matches
what happened before bug 552864, and is the only "sane" way to use
putenv.
2016-06-02 08:44:16 +09:00
Bob Owen
234469274c Bug 1278528: Don't try to initialize the sandbox TargetServices when we are not sandboxed. r=jimm
MozReview-Commit-ID: EpXy9LYXwQL
2016-06-07 14:03:51 +01:00
Jed Davis
48dd26ae20 Bug 1114647 - Use firefox for child processes instead of plugin-container. r=ted
Disabled on Mac (content processes need to use plugin-container.app for
UI reasons) and on Linux unless --disable-sandboxing (build issues).

Based on work by George Wright <george@mozilla.com>.
2016-06-03 12:49:39 -07:00
Bob Owen
a3e759646e Bug 1035125 Part 9: Link Chromium sandbox into firefox.exe instead of having a separate DLL. r=aklotz,glandium
MozReview-Commit-ID: 1vgDPjpcwz3
2016-05-15 16:41:40 +01:00
Mike Hommey
3582442233 Bug 1238769 - Add a -xpcshell option to Firefox. r=bsmedberg 2016-02-10 07:39:27 +09:00
Phil Ringnalda
dd6dd89c1f Back out 7af06ac5c280 (bug 1238769) for bustage
CLOSED TREE
2016-02-03 20:15:33 -08:00
Mike Hommey
b3b7fc15fe Bug 1238769 - Add a -xpcshell option to Firefox. r=bsmedberg 2016-02-04 12:49:57 +09:00
Mike Hommey
899f1cabf4 Bug 1211765 - Remove remnants from --with-libxul-sdk. r=bsmedberg
The configure option has explicitly thrown an error for more than a year now,
and it happens that the remaining way to still forcefully use it has been
broken for more than 8 months.
2015-10-14 08:02:34 +09:00
Gabriele Svelto
d9aa3cd009 Bug 858928 - Switch XRE_StartupTimelineRecord() from PRTime to TimeStamp. r=froydnj 2015-07-06 18:01:09 +02:00