From 982ea807c4a340e287f57b81770eadc037b8ecac Mon Sep 17 00:00:00 2001 From: Rootkit404 <175176948+RKNF404@users.noreply.github.com> Date: Sat, 14 Sep 2024 21:27:00 -0400 Subject: [PATCH 1/3] Add flag to disable JIT in all contexts --- patches/expose-flags.patch | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/patches/expose-flags.patch b/patches/expose-flags.patch index e27ac7b9..f8eea9d8 100644 --- a/patches/expose-flags.patch +++ b/patches/expose-flags.patch @@ -1,38 +1,38 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc -index 96370d4ac35a9..bc80527377261 100644 +index 96370d4ac35a9..6429e45f5013e 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -4190,6 +4190,36 @@ const FeatureEntry kFeatureEntries[] = { // //tools/flags/generate_unexpire_flags.py. #include "build/chromeos_buildflags.h" #include "chrome/browser/unexpire_flags_gen.inc" -+ {"incognito-launch", -+ "Incognito Launch", ++ {"incognito-launch", "Incognito Launch", + "Launch external links and open new sessions in Incognito. Disabled by " + "default. This flag is provided by hardened-chromium.", + kOsAll, FEATURE_VALUE_TYPE(features::kIncognitoLaunch)}, -+ {"extensions-support", -+ "Extensions Support", -+ "Toggle extensions support. This flag is exposed by hardened-chromium.", -+ kOsAll, SINGLE_DISABLE_VALUE_TYPE("disable-extensions")}, -+ {"disable-cross-origin-referrers", -+ "Clear cross-origin referrers", ++ {"extensions-support", "Extensions Support", ++ "Toggle extensions support. This switch is exposed by hardened-chromium.", ++ kOsAll, SINGLE_DISABLE_VALUE_TYPE(switches::kDisableExtensions)}, ++ {"v8-jit-support", "Webassembly and JavaScript JIT", ++ "Toggle V8 JIT for JavaScript and Webassembly on all pages. The " ++ "V8 optimizations toggle in preferences only affects webpages. This " ++ "switch is exposed by hardened-chromium", kOsAll, ++ SINGLE_DISABLE_VALUE_TYPE_AND_VALUE(blink::switches::kJavaScriptFlags, ++ "--jitless")}, ++ {"disable-cross-origin-referrers", "Clear cross-origin referrers", + "Clears referrers when navigating across origins. Defaults to disabled. " + "This feature is provided by hardened-chromium.", kOsAll, + FEATURE_VALUE_TYPE(net::features::kDisableCrossOriginReferrers)}, -+ {"cross-origin-trim-referrer", -+ "Cross-origin referrer trimming", ++ {"cross-origin-trim-referrer", "Cross-origin referrer trimming", + "Trims the referrer to just the origin on cross origin navigation. " + "Defaults to enabled. This feature is exposed by hardened-chromium.", + kOsAll, + FEATURE_VALUE_TYPE(net::features::kCapReferrerToOriginOnCrossOrigin)}, -+ {"hide-profile-icon", -+ "Hide profile icon in toolbar", ++ {"hide-profile-icon", "Hide profile icon in toolbar", + "Hides the profile icon in the toolbar in regular profiles. Defaults " + "to enabled. This feature is provided by hardened-chromium." , kOsAll, + FEATURE_VALUE_TYPE(features::kHideProfileIcon)}, -+ {"show-punycode-domains", -+ "Show punycode for IDN domains", ++ {"show-punycode-domains", "Show punycode for IDN domains", + "Shows punycode for IDN domains to mitigate IDN homograph attacks. " + "Defaults to disabled. This feature is provided by hardened-chromium.", + kOsAll, FEATURE_VALUE_TYPE(url::kShowPunycodeDomains)}, From 0a20c6fec8437f51fa7a254c73a8af2b5c606983 Mon Sep 17 00:00:00 2001 From: Rootkit404 <175176948+RKNF404@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:00:00 -0400 Subject: [PATCH 2/3] Invert wording on V8 JIT flag to imply disabling --- patches/expose-flags.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/patches/expose-flags.patch b/patches/expose-flags.patch index f8eea9d8..d8f644b7 100644 --- a/patches/expose-flags.patch +++ b/patches/expose-flags.patch @@ -13,11 +13,11 @@ index 96370d4ac35a9..6429e45f5013e 100644 + {"extensions-support", "Extensions Support", + "Toggle extensions support. This switch is exposed by hardened-chromium.", + kOsAll, SINGLE_DISABLE_VALUE_TYPE(switches::kDisableExtensions)}, -+ {"v8-jit-support", "Webassembly and JavaScript JIT", -+ "Toggle V8 JIT for JavaScript and Webassembly on all pages. The " -+ "V8 optimizations toggle in preferences only affects webpages. This " -+ "switch is exposed by hardened-chromium", kOsAll, -+ SINGLE_DISABLE_VALUE_TYPE_AND_VALUE(blink::switches::kJavaScriptFlags, ++ {"disable-v8-jit-globally", "Disable V8 JIT", ++ "Globally disable V8 JIT for JavaScript and Webassembly on all pages. " ++ "The V8 optimizations toggle in preferences only affects webpages. " ++ "This switch is exposed by hardened-chromium", kOsAll, ++ SINGLE_VALUE_TYPE_AND_VALUE(blink::switches::kJavaScriptFlags, + "--jitless")}, + {"disable-cross-origin-referrers", "Clear cross-origin referrers", + "Clears referrers when navigating across origins. Defaults to disabled. " From 37ce72963ddbc1fa8ad2a144d4c14420080d8367 Mon Sep 17 00:00:00 2001 From: Rootkit404 <175176948+RKNF404@users.noreply.github.com> Date: Sun, 15 Sep 2024 17:01:57 -0400 Subject: [PATCH 3/3] Small rewording --- patches/expose-flags.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/expose-flags.patch b/patches/expose-flags.patch index d8f644b7..ff147dee 100644 --- a/patches/expose-flags.patch +++ b/patches/expose-flags.patch @@ -13,8 +13,8 @@ index 96370d4ac35a9..6429e45f5013e 100644 + {"extensions-support", "Extensions Support", + "Toggle extensions support. This switch is exposed by hardened-chromium.", + kOsAll, SINGLE_DISABLE_VALUE_TYPE(switches::kDisableExtensions)}, -+ {"disable-v8-jit-globally", "Disable V8 JIT", -+ "Globally disable V8 JIT for JavaScript and Webassembly on all pages. " ++ {"disable-v8-jit-globally", "Disable V8 JIT Globally", ++ "Disable V8 JIT for JavaScript and Webassembly on all pages. " + "The V8 optimizations toggle in preferences only affects webpages. " + "This switch is exposed by hardened-chromium", kOsAll, + SINGLE_VALUE_TYPE_AND_VALUE(blink::switches::kJavaScriptFlags,