1*8975f5c5SAndroid Build Coastguard Worker# Copyright 2024 The Chromium Project. All rights reserved. 2*8975f5c5SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be 3*8975f5c5SAndroid Build Coastguard Worker# found in the LICENSE file. 4*8975f5c5SAndroid Build Coastguard Worker 5*8975f5c5SAndroid Build Coastguard Worker# The set of path prefixes that should be checked for unsafe pointer usage (see 6*8975f5c5SAndroid Build Coastguard Worker# -Wunsafe-buffer-usage in Clang). 7*8975f5c5SAndroid Build Coastguard Worker# 8*8975f5c5SAndroid Build Coastguard Worker# *** 9*8975f5c5SAndroid Build Coastguard Worker# Paths should be written as relative to the root of the source tree with 10*8975f5c5SAndroid Build Coastguard Worker# unix-style path separators. Directory prefixes should end with `/`, such 11*8975f5c5SAndroid Build Coastguard Worker# as `base/`. 12*8975f5c5SAndroid Build Coastguard Worker# *** 13*8975f5c5SAndroid Build Coastguard Worker# 14*8975f5c5SAndroid Build Coastguard Worker# Lines that begin with `-` name path prefixes that will *not* be checked for 15*8975f5c5SAndroid Build Coastguard Worker# unsafe-buffer-usage. They are known to do unsafe things and should be 16*8975f5c5SAndroid Build Coastguard Worker# changed to use constructs like base::span or containers like base::HeapArray 17*8975f5c5SAndroid Build Coastguard Worker# and std::vector instead. See https://crbug.com/40285824 18*8975f5c5SAndroid Build Coastguard Worker# 19*8975f5c5SAndroid Build Coastguard Worker# Lines that begin with `+` name path prefixes that have no unsafe-buffer-usage 20*8975f5c5SAndroid Build Coastguard Worker# (or all such usage is annotated), and are protected against new unsafe pointer 21*8975f5c5SAndroid Build Coastguard Worker# behaviour by the compiler. 22*8975f5c5SAndroid Build Coastguard Worker# 23*8975f5c5SAndroid Build Coastguard Worker# By default, all files are checked for unsafe-buffer-usage unless they are 24*8975f5c5SAndroid Build Coastguard Worker# match a `-` path prefix line here. If a file matches both a `-` and `+` line, 25*8975f5c5SAndroid Build Coastguard Worker# the `+` line takes precedence and the file will be checked. 26*8975f5c5SAndroid Build Coastguard Worker# 27*8975f5c5SAndroid Build Coastguard Worker# To opt individual files out of checks, place `#pragma allow_unsafe_buffers` 28*8975f5c5SAndroid Build Coastguard Worker# anywhere in the (source or header) file, guarded by 29*8975f5c5SAndroid Build Coastguard Worker# `#ifdef UNSAFE_BUFFERS_BUILD`. These pragmas represent the technical debt and 30*8975f5c5SAndroid Build Coastguard Worker# security risk present in the file through unsafe pointer usage. 31*8975f5c5SAndroid Build Coastguard Worker# 32*8975f5c5SAndroid Build Coastguard Worker# *** 33*8975f5c5SAndroid Build Coastguard Worker# Recommended process for removing a `-dir/` line from this file: 34*8975f5c5SAndroid Build Coastguard Worker# 35*8975f5c5SAndroid Build Coastguard Worker# 1. Remove the `-dir/` line from this paths file. 36*8975f5c5SAndroid Build Coastguard Worker# a. Possibly add some subdirectories if needed to reduce scope, 37*8975f5c5SAndroid Build Coastguard Worker# like `-dir/sub_dir/`. 38*8975f5c5SAndroid Build Coastguard Worker# 2. Add `#pragma allow_unsafe_buffers` to every file in the directory that now 39*8975f5c5SAndroid Build Coastguard Worker# has a compilation error, with a TODO to the tracking bug for the 40*8975f5c5SAndroid Build Coastguard Worker# directory: 41*8975f5c5SAndroid Build Coastguard Worker# ``` 42*8975f5c5SAndroid Build Coastguard Worker# #ifdef UNSAFE_BUFFERS_BUILD 43*8975f5c5SAndroid Build Coastguard Worker# // TODO(crbug.com/ABC): Remove this and convert code to safer constructs. 44*8975f5c5SAndroid Build Coastguard Worker# #pragma allow_unsafe_buffers 45*8975f5c5SAndroid Build Coastguard Worker# #endif 46*8975f5c5SAndroid Build Coastguard Worker# ``` 47*8975f5c5SAndroid Build Coastguard Worker# 3. Work through the files in the directory, converting pointers to spans, or 48*8975f5c5SAndroid Build Coastguard Worker# to owning containers like HeapArray and vector. Remove the pragmas from 49*8975f5c5SAndroid Build Coastguard Worker# the files when there is no unsafe pointer usage left in each one. 50*8975f5c5SAndroid Build Coastguard Worker# 51*8975f5c5SAndroid Build Coastguard Worker# See `docs/unsafe_buffers.md`. 52*8975f5c5SAndroid Build Coastguard Worker 53*8975f5c5SAndroid Build Coastguard Worker-android_webview/ 54*8975f5c5SAndroid Build Coastguard Worker-base/allocator 55*8975f5c5SAndroid Build Coastguard Worker-base/third_party 56*8975f5c5SAndroid Build Coastguard Worker-chrome/browser/ash/chromebox_for_meetings/ 57*8975f5c5SAndroid Build Coastguard Worker-chrome/browser/ash/policy/ 58*8975f5c5SAndroid Build Coastguard Worker-chrome/browser/component_updater/ 59*8975f5c5SAndroid Build Coastguard Worker-chrome/browser/extensions/api/messaging/ 60*8975f5c5SAndroid Build Coastguard Worker-chrome/browser/extensions/api/printing/ 61*8975f5c5SAndroid Build Coastguard Worker-chrome/browser/local_discovery/ 62*8975f5c5SAndroid Build Coastguard Worker-chrome/browser/media/webrtc 63*8975f5c5SAndroid Build Coastguard Worker-chrome/browser/platform_experience/win/ 64*8975f5c5SAndroid Build Coastguard Worker-chrome/browser/thumbnail/ 65*8975f5c5SAndroid Build Coastguard Worker-chrome/browser/ui/android/hats/ 66*8975f5c5SAndroid Build Coastguard Worker-chrome/browser/ui/webui/lens/ 67*8975f5c5SAndroid Build Coastguard Worker-chrome/browser/ui/webui/media_router/ 68*8975f5c5SAndroid Build Coastguard Worker-chrome/chrome_elf/third_party_dlls/ 69*8975f5c5SAndroid Build Coastguard Worker-chrome/common/profiler/ 70*8975f5c5SAndroid Build Coastguard Worker-chrome/credential_provider/ 71*8975f5c5SAndroid Build Coastguard Worker-chrome/elevation_service/ 72*8975f5c5SAndroid Build Coastguard Worker-chrome/services/cups_proxy/ 73*8975f5c5SAndroid Build Coastguard Worker-chrome/services/ipp_parser/public/cpp/ 74*8975f5c5SAndroid Build Coastguard Worker-chrome/services/sharing/nearby/decoder/ 75*8975f5c5SAndroid Build Coastguard Worker-chrome/test/ 76*8975f5c5SAndroid Build Coastguard Worker-chrome/tools/service_discovery_sniffer/ 77*8975f5c5SAndroid Build Coastguard Worker-chrome/updater/net/ 78*8975f5c5SAndroid Build Coastguard Worker-chromecast/ 79*8975f5c5SAndroid Build Coastguard Worker-chromeos/ash/components/memory/userspace_swap/ 80*8975f5c5SAndroid Build Coastguard Worker-chromeos/ash/components/system/ 81*8975f5c5SAndroid Build Coastguard Worker-chromeos/ash/services/libassistant/ 82*8975f5c5SAndroid Build Coastguard Worker-chromeos/components/kcer/kcer_nss 83*8975f5c5SAndroid Build Coastguard Worker-clank/ 84*8975f5c5SAndroid Build Coastguard Worker-components/allocation_recorder/ 85*8975f5c5SAndroid Build Coastguard Worker-components/chromeos_camera 86*8975f5c5SAndroid Build Coastguard Worker-components/commerce/ 87*8975f5c5SAndroid Build Coastguard Worker-components/crash/ 88*8975f5c5SAndroid Build Coastguard Worker-components/cronet/ 89*8975f5c5SAndroid Build Coastguard Worker-components/crx_file/ 90*8975f5c5SAndroid Build Coastguard Worker-components/desks_storage/ 91*8975f5c5SAndroid Build Coastguard Worker-components/device_event_log/ 92*8975f5c5SAndroid Build Coastguard Worker-components/exo/ 93*8975f5c5SAndroid Build Coastguard Worker-components/grpc_support/ 94*8975f5c5SAndroid Build Coastguard Worker-components/gwp_asan/ 95*8975f5c5SAndroid Build Coastguard Worker-components/media_router/ 96*8975f5c5SAndroid Build Coastguard Worker-components/open_from_clipboard/ 97*8975f5c5SAndroid Build Coastguard Worker-components/optimization_guide/internal/ 98*8975f5c5SAndroid Build Coastguard Worker-components/ownership/ 99*8975f5c5SAndroid Build Coastguard Worker-components/query_parser/ 100*8975f5c5SAndroid Build Coastguard Worker-components/segmentation_platform/ 101*8975f5c5SAndroid Build Coastguard Worker-components/sharing_message/ 102*8975f5c5SAndroid Build Coastguard Worker-components/system_cpu/ 103*8975f5c5SAndroid Build Coastguard Worker-components/url_formatter/ 104*8975f5c5SAndroid Build Coastguard Worker-components/url_pattern_index/ 105*8975f5c5SAndroid Build Coastguard Worker-components/webrtc_logging/ 106*8975f5c5SAndroid Build Coastguard Worker-components/zucchini/ 107*8975f5c5SAndroid Build Coastguard Worker-fuchsia_web/ 108*8975f5c5SAndroid Build Coastguard Worker-gpu/ipc/service/ 109*8975f5c5SAndroid Build Coastguard Worker-ios/ 110*8975f5c5SAndroid Build Coastguard Worker-ios_internal/ 111*8975f5c5SAndroid Build Coastguard Worker-native_client/ 112*8975f5c5SAndroid Build Coastguard Worker-net/third_party/ 113*8975f5c5SAndroid Build Coastguard Worker-printing/ 114*8975f5c5SAndroid Build Coastguard Worker-remoting/host/ 115*8975f5c5SAndroid Build Coastguard Worker-remoting/client/input/ 116*8975f5c5SAndroid Build Coastguard Worker-testing/iossim/ 117*8975f5c5SAndroid Build Coastguard Worker-third_party/ 118*8975f5c5SAndroid Build Coastguard Worker+third_party/blink/ 119*8975f5c5SAndroid Build Coastguard Worker-tools/ 120*8975f5c5SAndroid Build Coastguard Worker-url/third_party 121*8975f5c5SAndroid Build Coastguard Worker-v8/ 122*8975f5c5SAndroid Build Coastguard Worker 123*8975f5c5SAndroid Build Coastguard Worker# Before clearing this directory, make sure to run against a bot running 124*8975f5c5SAndroid Build Coastguard Worker# with the build flag: use_internal_isolated_origins. There are none on the CQ 125*8975f5c5SAndroid Build Coastguard Worker# by default. See file components/site_isolation/preloaded_isolated_origins.cc 126*8975f5c5SAndroid Build Coastguard Worker-components/site_isolation/ 127*8975f5c5SAndroid Build Coastguard Worker 128*8975f5c5SAndroid Build Coastguard Worker# TODO(crbug.com/41497066#comment22) The Win SDK headers don't get categorized 129*8975f5c5SAndroid Build Coastguard Worker# as system headers when building with DEPOT_TOOLS_WIN_TOOLCHAIN=0 ? 130*8975f5c5SAndroid Build Coastguard Worker-Program Files (x86)/Windows Kits/ 131*8975f5c5SAndroid Build Coastguard Worker 132*8975f5c5SAndroid Build Coastguard Worker# Please be cautious before removing this opt-out, because it won't show up on 133*8975f5c5SAndroid Build Coastguard Worker# the Mega-CQ, nor Sheriffs' dashboards. See https://crbug.com/361760067 134*8975f5c5SAndroid Build Coastguard Worker# Removing this directory may fail on the bot CI bot: 135*8975f5c5SAndroid Build Coastguard Worker# https://luci-milo.appspot.com/ui/p/chrome/builders/official/win-arm64-clang 136*8975f5c5SAndroid Build Coastguard Worker-chrome/installer/ 137*8975f5c5SAndroid Build Coastguard Worker 138*8975f5c5SAndroid Build Coastguard Worker# Please check 'linux-v4l2-codec-rel' bot before removing this opt-out. 139*8975f5c5SAndroid Build Coastguard Worker-media/gpu/v4l2/ 140*8975f5c5SAndroid Build Coastguard Worker 141*8975f5c5SAndroid Build Coastguard Worker# //codelabs is a directory that contains examples for developers to modify as 142*8975f5c5SAndroid Build Coastguard Worker# they learn about chromium development. This is indefinitely opt-out because 143*8975f5c5SAndroid Build Coastguard Worker# it is not part of the main build, and we don't want developers to be blocked 144*8975f5c5SAndroid Build Coastguard Worker# by this check. 145*8975f5c5SAndroid Build Coastguard Worker-codelabs/ 146