summaryrefslogtreecommitdiffstats
path: root/security/sandbox/chromium-shim/patches/with_update/revert_TargetNtSetInformationThread_change.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /security/sandbox/chromium-shim/patches/with_update/revert_TargetNtSetInformationThread_change.patch
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'security/sandbox/chromium-shim/patches/with_update/revert_TargetNtSetInformationThread_change.patch')
-rw-r--r--security/sandbox/chromium-shim/patches/with_update/revert_TargetNtSetInformationThread_change.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/security/sandbox/chromium-shim/patches/with_update/revert_TargetNtSetInformationThread_change.patch b/security/sandbox/chromium-shim/patches/with_update/revert_TargetNtSetInformationThread_change.patch
new file mode 100644
index 0000000000..60bb45e3af
--- /dev/null
+++ b/security/sandbox/chromium-shim/patches/with_update/revert_TargetNtSetInformationThread_change.patch
@@ -0,0 +1,39 @@
+# HG changeset patch
+# User Bob Owen <bobowencode@gmail.com>
+# Date 1510058662 0
+# Tue Nov 07 12:44:22 2017 +0000
+# Node ID 5b2b8b6c509a1025ef6d6ba208b093d4c4359186
+# Parent 2c3a28eab0bfcaa5a14771454f83703ae938da6c
+Revert commit f7540af7428f4b146136ec19b781886693f8c03f changes to policy_target.cc for causing issues with CoInitializeSecurity. r=aklotz
+
+diff --git a/security/sandbox/chromium/sandbox/win/src/policy_target.cc b/security/sandbox/chromium/sandbox/win/src/policy_target.cc
+--- a/security/sandbox/chromium/sandbox/win/src/policy_target.cc
++++ b/security/sandbox/chromium/sandbox/win/src/policy_target.cc
+@@ -78,16 +78,26 @@ NTSTATUS WINAPI TargetNtSetInformationTh
+ NT_THREAD_INFORMATION_CLASS thread_info_class,
+ PVOID thread_information,
+ ULONG thread_information_bytes) {
+ do {
+ if (SandboxFactory::GetTargetServices()->GetState()->RevertedToSelf())
+ break;
+ if (ThreadImpersonationToken != thread_info_class)
+ break;
++ if (!thread_information)
++ break;
++ HANDLE token;
++ if (sizeof(token) > thread_information_bytes)
++ break;
++
++ NTSTATUS ret = CopyData(&token, thread_information, sizeof(token));
++ if (!NT_SUCCESS(ret) || NULL != token)
++ break;
++
+ // This is a revert to self.
+ return STATUS_SUCCESS;
+ } while (false);
+
+ return orig_SetInformationThread(
+ thread, thread_info_class, thread_information, thread_information_bytes);
+ }
+
+ // Hooks NtOpenThreadToken to force the open_as_self parameter to be set to