cryptohome: Do not unmount children of known in-use mount

When cryptohome crashes while the user is logged in, no mounts would be
owned, and some critical mount points (MyFiles/Download, /run/daemon-store..)
would not point to inside user directories anymore.

When CleanUpStaleMounts() is called in non force mode, when a mount
source is used, all its children are now assumed to be used.

Conflicts:
	cryptohome/service_unittest.cc: arraysize() was used.

BUG=chromium:1080730
TEST=Crashing cryptohomed does not remove MyFiles/Download anymore.
Unit tests pass.

Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2215637
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Commit-Queue: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Change-Id: I75a18c59d5cd484da34c78784e81b4cea4fdc857
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2222469
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Commit-Queue: Gwendal Grignou <gwendal@chromium.org>
3 files changed
tree: 6e5e7a8fbff80d1f423b4a2bb7ee1ea4a8fbbf23
  1. arc/
  2. attestation/
  3. authpolicy/
  4. avtest_label_detect/
  5. biod/
  6. bluetooth/
  7. bootstat/
  8. buffet/
  9. camera/
  10. cfm-dfu-notification/
  11. chaps/
  12. chromeos-common-script/
  13. chromeos-config/
  14. chromeos-dbus-bindings/
  15. chromeos-nvt-tcon-updater/
  16. codelab/
  17. common-mk/
  18. crash-reporter/
  19. cros-disks/
  20. cros-fuzz/
  21. cros_component/
  22. crosdns/
  23. crosh/
  24. cryptohome/
  25. cups_proxy/
  26. debugd/
  27. dev-install/
  28. diagnostics/
  29. disk_updater/
  30. dlcservice/
  31. easy-unlock/
  32. feedback/
  33. fitpicker/
  34. glib-bridge/
  35. goldfishd/
  36. hammerd/
  37. hardware_verifier/
  38. hermes/
  39. image-burner/
  40. imageloader/
  41. init/
  42. installer/
  43. ippusb_manager/
  44. kerberos/
  45. libbrillo/
  46. libchromeos-rs/
  47. libchromeos-ui/
  48. libcontainer/
  49. libhwsec/
  50. libipp/
  51. libmems/
  52. libpasswordprovider/
  53. libtpmcrypto/
  54. login_manager/
  55. lorgnette/
  56. media_perception/
  57. mems_setup/
  58. metrics/
  59. midis/
  60. mist/
  61. ml/
  62. modem-utilities/
  63. modemfwd/
  64. mtpd/
  65. oobe_config/
  66. p2p/
  67. permission_broker/
  68. policy_proto/
  69. policy_utils/
  70. power_manager/
  71. print_tools/
  72. qmi2cpp/
  73. regions/
  74. rendernodehost/
  75. run_oci/
  76. runtime_probe/
  77. salsa/
  78. screenshot/
  79. sealed_storage/
  80. secure-wipe/
  81. secure_erase_file/
  82. sepolicy/
  83. shill/
  84. smbfs/
  85. smbprovider/
  86. smogcheck/
  87. st_flash/
  88. storage_info/
  89. system-proxy/
  90. system_api/
  91. thd/
  92. timberslide/
  93. touch_firmware_calibration/
  94. touch_keyboard/
  95. tpm2-simulator/
  96. tpm_manager/
  97. tpm_softclear_utils/
  98. trace_events/
  99. trim/
  100. trunks/
  101. u2fd/
  102. ureadahead-diff/
  103. usb_bouncer/
  104. userfeedback/
  105. userspace_touchpad/
  106. virtual_file_provider/
  107. vm_tools/
  108. vpn-manager/
  109. webserver/
  110. wifi-testbed/
  111. .clang-format
  112. .gitignore
  113. .gn
  114. CPPLINT.cfg
  115. LICENSE
  116. navbar.md
  117. OWNERS
  118. PRESUBMIT.cfg
  119. PRESUBMIT.py
  120. README.md
README.md

The Chromium OS Platform

This repo holds (most) of the custom code that makes up the Chromium OS platform. That largely covers daemons, programs, and libraries that were written specifically for Chromium OS.

We moved from multiple separate repos in platform/ to a single repo in platform2/ for a number of reasons:

  • Make it easier to work across multiple projects simultaneously
  • Increase code re-use (via common libs) rather than duplicate utility functions multiple items over
  • Share the same build system

While most projects were merged, not all of them were. Some projects were standalone already (such as vboot), or never got around to being folded in (such as imageloader). Some day those extra projects might get merged in.

Similarly, some projects that were merged in, were then merged back out. This was due to the evolution of the Brillo project and collaboration with Android. That means the AOSP repos are the upstream and Chromium OS carries copies.

Local Project Directory

ProjectDescription
arcTools/deamons/init-scripts to run ARC
attestationDaemon and client for managing remote attestation
authpolicyDaemon for integrating with Microsoft Active Directory (AD) domains
avtest_label_detectTest tool for OCRing device labels
biodBiometrics daemon
bluetoothBluetooth Service and tools
bootstatTools for tracking points in the overall boot process (for metrics)
buffetDaemon for reacting to cloud messages
cameraChrome OS Camera daemon
cfm-dfu-notificationCFM specific library for DFU notifications
chapsPKCS #11 implementation for TPM 1 devices
chromeos-common-scriptShared scripts for partitions and basic disk information
chromeos-configCrOS unified build runtime config manager
chromeos-dbus-bindingsSimplifies the implementation of D-Bus daemons and proxies
chromeos-nvt-tcon-updaterLibrary for integrating the Novatek TCON firmware updater into a CrOS device
codelabCodelab exercise
common-mkCommon build & test logic for platform2 projects
crash-reporterThe system crash handler & reporter
cros-disksDaemon for mounting removable media (e.g. USB sticks and SD cards)
cros-fuzzSupport crate for fuzzing rust code
cros_component
crosdnsHostname resolution service for Chrome OS
croshThe Chromium OS shell
cryptohomeDaemon and tools for managing encrypted /home and /var directories
cups_proxyDaemon for proxying CUPS printing request
debugdCentralized debug daemon for random tools
dev-installTools & settings for managing the developer environment on the device
diagnosticsDevice telemetry and diagnostics daemons
disk_updaterUtility for updating root disk firmware (e.g. SSDs and eMMC)
dlcserviceDownloadable Content (DLC) Service daemon
easy-unlockDaemon for handling Easy Unlock requests (e.g. unlocking Chromebooks with an Android device)
feedbackDaemon for headless systems that want to gather feedback (normally Chrome manages it)
fitpicker
glib-bridgelibrary for libchrome-glib message loop interoperation
goldfishdAndroid Emulator Daemon
hammerdFirmware updater utility for hammer hardware
hardware_verifierHardware verifier tool
hermesChrome OS LPA implementation for eSIM hardware support
image-burnerDaemon for writing disk images (e.g. recovery) to USB sticks & SD cards
imageloaderDaemon for mounting signed disk images
initCrOS common startup init scripts and boot time helpers
installerCrOS installer utility (for AU/recovery/etc...)
ippusb_manager“Service” for ipp-over-usb printing
kerberosDaemon for managing Kerberos tickets
libbrilloCommon platform utility library
libchromeos-rsCommon platform utility library for Rust
libchromeos-ui
libcontainer
libhwsecLibrary for the utility functions of all TPM related daemons
libippLibrary for building and parsing IPP (Internet Printing Protocol) frames
libmemsUtility library to configure, manage and retrieve events from IIO sensors
libpasswordproviderPassword Provider library for securely managing credentials with system services
libtpmcryptoLibrary for AES256-GCM encryption with TPM sealed keys
login_managerSession manager for handling the life cycle of the main session (e.g. Chrome)
lorgnetteDaemon for managing attached USB scanners via SANE
media_perceptionMedia perception service for select platforms
memdDaemon that logs memory-related data and events
mems_setupBoot-time initializer tool for sensors
metricsClient side user metrics collection
midisMIDI service
mistModem USB Interface Switching Tool
mlMachine learning service
modem-utilities
modemfwdDaemon for managing modem firmware updaters
mtpdDaemon for handling Media Transfer Protocol (MTP) with devices (e.g. phones)
oobe_configUtilities for saving and restoring OOBE config state
p2pService for sharing files between CrOS devices (e.g. updates)
permission_broker
policy_protoBuild file to compile policy proto file
policy_utilsTools and related library to set or override device policies
power_managerUserspace power management daemon and associated tools
print_toolsVarious tools related to the native printing system
qmi2cppChrome OS QMI IDL Compiler
regions
rendernodehostRender node forward library
run_ociMinimalistic container runtime
runtime_probeRuntime probe tool for ChromeOS
salsaTouchpad experimentation framework
screenshotTiny command to take a screenshot
sealed_storageLibrary for sealing data to device identity and state
secure-wipeSecure disk wipe
secure_erase_fileHelper tools for securely erasing files from storage (e.g. keys and PII data)
sepolicySELinux policy for Chrome OS
shillChrome OS Connection Manager
smbfsFUSE-based filesystem for accessing Samba / Windows networking shares
smbproviderDaemon for connecting Samba / Windows networking shares to the Files.app
smogcheckDeveloper library for working with raw I2C devices
st_flash
storage_infoHelper shell functions for retrieving disk information)
system-proxyDaemon for web proxy authentication support on Chrome OS
system_apiHeaders and .proto files etc. to be shared with chromium
thdThermal daemon to help keep systems running cool
timberslideTool for working with EC crashes for reporting purposes
touch_firmware_calibration
touch_keyboardUtilities for a touch based virtual keyboard
tpm2-simulatorA software TPM 2.0 implementation (for testing/debugging)
tpm_managerDaemon and client for managing TPM setup and operations
tpm_softclear_utilsUtilities that soft-clear TPM (for testing only)
trace_eventsA framework for adding trace events to your Rust code.
trimService to manage filesystem trim operations in the background
trunksMiddleware and resource manager for interfacing with TPM 2.0 hardware
u2fdU2FHID emulation daemon for systems with secure elements (not TPMs)
ureadahead-diffTool to calculate difference between 2 ureadahead packs
usb_bouncerTools for managing USBGuard white-lists and configuration on Chrome OS
userfeedbackVarious utilities to gather extended data for user feedback reports
userspace_touchpad
virtual_file_provider
vm_toolsUtilities for Virtual Machine (VM) orchestration
vpn-managerChrome OS Native L2TP/IPSec VPN Daemon
webserverSmall web server with D-Bus client backends
wifi-testbedTools for creating a WiFi testbed image

AOSP Project Directory

These projects can be found here: https://chromium.googlesource.com/aosp/platform/