Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7e5fca58 authored by Dennis Shen's avatar Dennis Shen
Browse files

aconfig: create aconfig_storage_write_api crate

aconfig_storage_write_api crate is the lib to be used by aconfig storage
daemon to update flag value at a given offset.

Note that mmap api is unsafe from memmap2 crate. This is due to the
possibility of other code write to the file after mmaping the file into
memory. Therefore the api to write to storage value file is also marked
as unsafe. In reality, the persistent storage value file is protected by
SELinux policy to allow write access only to aconfig storage daemon. In
addition, aconfig storage daemon is single threaded. So at any time,
only one thread is writing to a storage file, and only thru the mmapped
file in memory (not thru direct file write). So it would safe for
storage daemon to call this api.

Bug: b/312444587
Test: m libaconfig_storage_write_api; atest
aconfig_storage_write_api.test

Change-Id: I93cffea0d94e4c40e711d809418c0b18b6d9bfe1
parent 05b128bf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment