Bug 1520310 - Backout the patch from Bug 1498695 and cast to void*. r=bobowen
authorTom Ritter <tom@mozilla.com>
Mon, 21 Jan 2019 14:13:17 -0600
changeset 514779 754481bfbe992e8754ce9af79b5a33f9412d186f
parent 514778 0f709682e4a01b425d7b863d1e17b9496903a8ff
child 514780 d94203c1f6b52716801969622868a56361af7cb5
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbobowen
bugs1520310, 1498695, 1462100
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1520310 - Backout the patch from Bug 1498695 and cast to void*. r=bobowen In Bug 1462100 we started casting to void* because mingw doesn't do automatic conversions like MSVC does. In Bug 1498695 I backed out that change because I (mistakenly) thought it wasn't necessary for mingw-clang when in actuality, I simply wasn't hitting the code path due to SANDBOX_EXPORTS being defined. Since we want to _not_ define SANDBOX_EXPORTS I need to put the original patch back in place.
security/sandbox/chromium-shim/patches/with_update/mingw_noexports_casts.patch
security/sandbox/chromium-shim/patches/with_update/patch_order.txt
security/sandbox/chromium/sandbox/win/src/interception.h
new file mode 100644
--- /dev/null
+++ b/security/sandbox/chromium-shim/patches/with_update/mingw_noexports_casts.patch
@@ -0,0 +1,41 @@
+# HG changeset patch
+# User Tom Ritter <tom@mozilla.com>
+# Date 1526498300 18000
+#      Wed May 16 14:18:20 2018 -0500
+# Node ID dd3f4940aeb0c4e00e8bcf1c238f2355ad793489
+# Parent  cf646c80b9545db7ab548f88a482378734ee2f78
+Bug 1462100 Cast to void* to avoid conversion errors on MinGW, which does not do the automatic conversion like msvc r?bobowen
+
+MozReview-Commit-ID: 8fO9Nu9gaxh
+
+diff --git a/security/sandbox/chromium/sandbox/win/src/interception.h b/security/sandbox/chromium/sandbox/win/src/interception.h
+--- a/security/sandbox/chromium/sandbox/win/src/interception.h
++++ b/security/sandbox/chromium/sandbox/win/src/interception.h
+@@ -264,25 +264,25 @@ class InterceptionManager {
+ #define MAKE_SERVICE_NAME(service) &Target##service##64
+ #else
+ #define MAKE_SERVICE_NAME(service) &Target##service
+ #endif
+ 
+ #define ADD_NT_INTERCEPTION(service, id, num_params) \
+   AddToPatchedFunctions(kNtdllName, #service, \
+                         sandbox::INTERCEPTION_SERVICE_CALL, \
+-                        MAKE_SERVICE_NAME(service), id)
++                        (void*)MAKE_SERVICE_NAME(service), id)
+ 
+ #define INTERCEPT_NT(manager, service, id, num_params) \
+   manager->ADD_NT_INTERCEPTION(service, id, num_params)
+ 
+ // When intercepting the EAT it is important that the patched version of the
+ // function not call any functions imported from system libraries unless
+ // |TargetServices::InitCalled()| returns true, because it is only then that
+ // we are guaranteed that our IAT has been initialized.
+ #define INTERCEPT_EAT(manager, dll, function, id, num_params) \
+   manager->AddToPatchedFunctions(dll, #function, sandbox::INTERCEPTION_EAT, \
+-                                 MAKE_SERVICE_NAME(function), id)
++                                 (void*)MAKE_SERVICE_NAME(function), id)
+ #endif  // SANDBOX_EXPORTS
+ 
+ }  // namespace sandbox
+ 
+ #endif  // SANDBOX_SRC_INTERCEPTION_H_
--- a/security/sandbox/chromium-shim/patches/with_update/patch_order.txt
+++ b/security/sandbox/chromium-shim/patches/with_update/patch_order.txt
@@ -13,10 +13,11 @@ allow_read_only_all_paths_rule.patch
 revert_TargetNtSetInformationThread_change.patch
 mingw_base_win_get_caller.patch
 mingw_duplicate_instatinations.patch
 mingw_copy_s.patch
 mingw_operator_new.patch
 mingw_cast_getprocaddress.patch
 mingw_capitalization.patch
 mingw_disable_one_try.patch
+mingw_noexports_casts.patch
 mingw_offsetof.patch
 add_aarch64_windows_support.patch
--- a/security/sandbox/chromium/sandbox/win/src/interception.h
+++ b/security/sandbox/chromium/sandbox/win/src/interception.h
@@ -264,25 +264,25 @@ class InterceptionManager {
 #define MAKE_SERVICE_NAME(service) &Target##service##64
 #else
 #define MAKE_SERVICE_NAME(service) &Target##service
 #endif
 
 #define ADD_NT_INTERCEPTION(service, id, num_params) \
   AddToPatchedFunctions(kNtdllName, #service, \
                         sandbox::INTERCEPTION_SERVICE_CALL, \
-                        MAKE_SERVICE_NAME(service), id)
+                        (void*)MAKE_SERVICE_NAME(service), id)
 
 #define INTERCEPT_NT(manager, service, id, num_params) \
   manager->ADD_NT_INTERCEPTION(service, id, num_params)
 
 // When intercepting the EAT it is important that the patched version of the
 // function not call any functions imported from system libraries unless
 // |TargetServices::InitCalled()| returns true, because it is only then that
 // we are guaranteed that our IAT has been initialized.
 #define INTERCEPT_EAT(manager, dll, function, id, num_params) \
   manager->AddToPatchedFunctions(dll, #function, sandbox::INTERCEPTION_EAT, \
-                                 MAKE_SERVICE_NAME(function), id)
+                                 (void*)MAKE_SERVICE_NAME(function), id)
 #endif  // SANDBOX_EXPORTS
 
 }  // namespace sandbox
 
 #endif  // SANDBOX_SRC_INTERCEPTION_H_