Files
TheRock/rocm-systems/projects/rocprofiler-systems/external/perfetto/docs/design-docs/security-model.md
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

3.0 KiB

Security model for system-wide tracing on Android/Linux

The tracing service has two endpoints (in Chromium: Mojo services, on Android/Linux: UNIX sockets): one for producer(s) and one for consumer(s). The former is typically public, the latter is restricted only to trusted consumers.

Security overview

Producers

Producers are never trusted. We assume they will try their best to DoS / crash / exploit the tracing service. We do so at the service/tracing_service_impl.cc so that the same level of security and testing is applied regardless of the embedder and the IPC transport.

Tracing service

  • The tracing service has to validate all inputs.
  • In the worst case a bug in the tracing service allowing remote code execution, the tracing service should have no meaningful capabilities to exploit.
  • The tracing service, by design, has a limited syscall surface to simplify its sandboxing:
    • It doesn't open or create files (% tmpfs).
    • It writes only onto file descriptors passed over the IPC channel.
    • It doesn't open or create sockets (on Android the IPC sockets are passed by init, see perfetto.rc)
    • On Android it runs as nobody:nobody and is allowed to do very little see traced.te.
    • In Chromium it should run as a utility process.

Consumers

Consumers are always trusted. They still shouldn't be able to crash or exploit the service. They can easily DoS it though, but that is WAI.

  • In Chromium the trust path is established through service manifest.
  • In Android the trust path is established locking down the consumer socket to shell through SELinux.

Shared memory isolation

Memory is shared only point-to-point between each producer and the tracing service. We should never ever share memory across producers (in order to not leak trace data belonging to different producers) nor between producers and consumers (that would open a hard to audit path between untrusted-and-unprivileged and trusted-and-more-privileged entities).

Attestation of trace contents

The tracing service guarantees that the TracePacket fields written by the Service cannot be spoofed by the Producer(s).
Packets that try to define those fields are rejected, modulo clock snapshots.
See PacketStreamValidator and its unit test for more details.
At the moment nothing prevents that a producer writes TracePacket(s) that do not belong to its data sources. Realistically the service will never prevent that because doing so would imply that the service knows about all the possible types of packets, which doesn't scale.
However, the service appends the POSIX uid of the producer to each TracePacket to perform offline attestation of the contents of the trace.