From def92d1b8e9d373e2f6f27c366d578d97d8960c6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:34:50 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- .../sandbox/chromium/sandbox/win/src/restricted_token_utils.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'security/sandbox/chromium') diff --git a/security/sandbox/chromium/sandbox/win/src/restricted_token_utils.cc b/security/sandbox/chromium/sandbox/win/src/restricted_token_utils.cc index d93386d646..b4830bd253 100644 --- a/security/sandbox/chromium/sandbox/win/src/restricted_token_utils.cc +++ b/security/sandbox/chromium/sandbox/win/src/restricted_token_utils.cc @@ -307,6 +307,14 @@ DWORD SetProcessIntegrityLevel(IntegrityLevel integrity_level) { return ERROR_SUCCESS; } + // Set integrity level for our process ACL, so we retain access to it. + // We ignore failures because this is not a security measure, but some + // functionality may fail later in the process. + DWORD rv = + SetObjectIntegrityLabel(::GetCurrentProcess(), SE_KERNEL_OBJECT, L"", + GetIntegrityLevelString(integrity_level)); + DCHECK(rv == ERROR_SUCCESS); + HANDLE token_handle; if (!::OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_DEFAULT, &token_handle)) -- cgit v1.2.3