Files
tubestation/security/sandbox/linux/gtest/SandboxProfiler.cpp
Alexandre Lissy f87936fcfa Bug 1884378 - Introduce SandboxProfiler r=padenot
Provide a way to forward sandbox decisions and syscalls interceptions to
the profiler, with child-side stack in the reports.

Introduces a new SandboxProfilerEmitter thread that will be able to deal
with what cannot be done in the context of a signal handler.

Child-side syscalls interceptions with stacks requires a bit of care
because of the signal context it is running under. Taking a stack is
safe in that context but dealing with the profiler is not, thus relying
on the MPSCQueue data structure:
 - when in SIGSYS because a syscall has been intercepted, take a stack
 - forward the syscall informations plus the stack within the MPSCQueue
 - SandoxProfilerEmitter can then read from the queue and perform the
   heavy work with the profiler

Differential Revision: https://phabricator.services.mozilla.com/D207736
2024-06-14 10:17:36 +00:00

23 lines
833 B
C++

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#include "SandboxProfiler.h"
namespace mozilla {
/* static */
void SandboxProfiler::ReportRequest(const void* top, uint64_t aId,
const char* aOp, int aFlags,
const char* aPath, const char* aPath2,
pid_t aPid) {
/*
* Just an empty no op for gtest, otherwise we end up with linkage failure,
* and adding the real SandboxProfiler.cpp to the gtest linkage breaks
* because we want to keep separated symbols for uprofiler/uprofiler_initted
* and gtest links all together.
* */
}
} // namespace mozilla