Glibc >=2.32 exposes a gettid() which clashes with libcutils
thread.h, so add a check to not expose it if building against
newer glibc (ChromiumOS will still use glibc 2.27 besides 2.32).
Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1182060
Test: Builds without errors on both glibc 2.32 and 2.27.
Change-Id: Ib71fa1bc9fa185e3668002407dbed05a80c87740
We don't have any right now. Let's keep it that way.
Also remove a bunch of duplication/cruft in the build file.
Test: treehugger
Change-Id: I406985592c175f45660e87adb05231bce0804893
This function is no longer necessary, and uses a deprecated API
(mallopt(M_BIONIC_DISABLE_MEMORY_MITIGATIONS)). This function was
provided originally as part of libcutils because the original API was a
private android_mallopt.
The API is being reborn as a memory-init-specific mallopt. Given that
regular system components and apps will be able to call it directly,
it's not necessary to have a wrapper function in libcutils any more.
Bug: 135772972
Test: Build the device.
Change-Id: I4a3185b99702c8e445de6837b154c4a96c8295a1
C++ thread_local is less code to write, and performs better. All known
users have been moved over already.
Test: treehugger
Change-Id: Idaa2a58bf23342dae08dd6b9003d8f532839b351
vendor_available modules were available to product modules.
However, not all vendor_available modules are required to be
available to product modules. Some modules want to be available only
to product modules but not vendor modules.
To cover the requirement, we separate product_available from
vendor_available.
vendor_available will not provide product available module.
Rename libcutils/include_vndk to libcutils/include_outside_system as
it provides the headers to the modules outside the system partition
including /product.
Bug: 150902910
Test: build
Change-Id: I791b5a6a1dc99442065debfce6fa0f54a335fcea
libcutils' thread local stuff is almost unused already, so let's try
harder to prevent new users. (In parallel I'll try to actually move the
four existing users off it, so we can actually remove this.)
Test: treehugger
Change-Id: Ib5445a43cff1f161ce1c7a45959d5b126f6f6980
Now that tune2fs and resize2fs may be dynamic, add linker[64] to
first_stage_ramdisk/system/bin.
Test: boot and examine serial output, ensure tune2fs and resize2fs
can be executed.
Bug: 173425293
Change-Id: I35699b38ddf5004c04ec0adc1b0c54d5d9c92ae6
Convenience API to disable memory mitigations, where we can specify
logging and also have a single place to update once a related bug is
fixed.
Bug: 166675194
Test: use API to disable memory mitigations
Change-Id: I4a3529ea1911925c49e31cc3809c2743e401c196
Added missing partitions (/product and /vendor).
APEXes can be put in /system, /system_ext, /product, and /vendor.
Binaries within "flattened" apexes should be marked as executable.
Bug: 167383491
Bug: 169025459
Test: OVERRIDE_TARGET_FLATTEN_APEX=true m vendorimage with a vendor apex
simg2img $OUT/vendor.img vendor.img
debugfs -R 'ls -l /vendor/apex/com.android.foo/bin' vendor.img
=> check if binaries are executable
Change-Id: I67284166d70c98a2a184b47e7052ade8b9039df9
android_filesystem_config.h is found since system/core/include is on
the include path for all projects and contains a symlink to the real
android_filesystem_config.h. This is fragile and the below bug seeks
to remove this symlink and have users correctly depend on
libcutils_headers.
Bug: 165825252
Test: build
Change-Id: I1aad6a2e8fbe87635e97b0ac1be3414403353382
Currently it falls back to /sys/kernel/tracing if debugfs is not found.
/sys/kernel/tracing must be checked first since debugfs is not allowed
to be mounted in user builds starting with Android R launching devices.
Test: manual
Change-Id: I2fb5ec91bbf7d5304a1a6efcb06530969485e78f
Fix the memfd_create(2) path and add the missing unit test.
Bug: https://issuetracker.google.com/165667331
Test: treehugger
Change-Id: Ibb5c1d0f9d7caba1df04d1f03e82e55026d9f86a
Introduce a new systrace tag, TRACE_TAG_SYSPROP, for use with
system property.
Bug: 147275573
Test: build
Change-Id: I6f85f3f52f6580bab4ff43fc1dc0e87c689b054e
Merged-In: I6f85f3f52f6580bab4ff43fc1dc0e87c689b054e
(cherry picked from commit 573fc58bad)
This directory contains only the su binary which is executable only by
root and shell uids, so need not be accessible to other users.
Test: Device boots
Test: adb shell ls -ld /system/xbin
Change-Id: I4c9daab68b29832ef0ace2dec274687e4496da81
AudioHAL and SoundtriggerHAL is separeted HAL but running in thread with
same process id.
So, if both HAL try to open netlink socket using uevent_open_socket(),
secondly opening socket receives already-in-use error.
To prevent situation, set 0 to socket port id.
By the LINUX man page, "The kernel assigns the process ID to the first
netlink socket the process opens and assigns a unique nl_pid to every
netlink socket that the process subsequently creates."
Bug:163008274
Test: tested by opening netlink socket in AudioHAL and
SoundtriggerHAL both.
Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Change-Id: I5f9859e8dac749bf5d0998e825043c9988c202ba
This makes the system property functions available on the host too, and
ensures a consistent view of system properties between libcutils and
libbase, if you have code running on the host that uses both.
Bug: http://b/151789258
Test: treehugger
Change-Id: Ie524a77d0c392d7b23e9d12becbb1bf53c81eac6
The atrace buffer does not need to be zero-initialized every time.
Test: memset calls from atrace_{begin,end}_body are gone
bug 155788214
Change-Id: I8082b6a9e6d6328f4aee3a22137977e9fae21933
The *kernel* header is "GPL-2.0 OR Apache-2.0", but the userspace
libcutils is just Apache-2.0 like all our code.
Test: builds
Change-Id: I25eef8eed16550f4010285479b21b502a2d1fc07
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.
For now setting min_sdk_version doesn't change build outputs.
But build-time checks will be added soon.
Bug: 152655956
Test: m
Change-Id: I453c63fe29607ea0312da5465b03c741486fb670
The marked library(ies) were available to the APEXes via the hand-written
whitelist in build/soong/apex/apex.go. Trying to remove the whitelist
by adding apex_available property to the Android.bp of the libraries.
In this change, following libs were made available to all apexes because
their usage is quite common and there is no reason to restrict them
to some APEXes.
* libbase_headers
* libcutils, libcutils_headers
* libutils_headers, libsystem_headers
* liblog_headers
* libbacktrace, libbacktrace_headers
* libcrypto_utils
Exempt-From-Owner-Approval: cherry-pick from aosp
Bug: 150999716
Test: m
Merged-In: If3d3652e6604ed4f6d7694fe7ac61ae496621026
(cherry picked from commit 8bf9b1632e)
Change-Id: If3d3652e6604ed4f6d7694fe7ac61ae496621026
Switch the __x86.get_pc_thunk.bx functions from .gnu.linkonce to comdat
section groups. lld doesn't implement .gnu.linkonce and will instead
discard the input sections. It might produce a faulty binary that has
no get_pc_thunk function in it, which would crash.
Normally, these functions are generated by GCC and are present in many
object files compiled with PIC. Clang doesn't use them, and instead
initializes the PIC base register with a "call 1f; 1: pop %ebx" pair.
I also added cfi_startproc / cfi_endproc to be consistent with current
GCC output.
I marked this CL with do-not-merge because the code it touches has been
removed in the next release, so it won't merge. I reviewed the
automerger graph, and this do-not-merge CL:
- will be applied to qt-qpr1-dev-plus-aosp (which needs the CL)
- won't be applied to rvc-dev-plus-aosp (which doesn't need the CL)
https://android-build.googleplex.com/builds/automerger/graph/project/googleplex-android/platform/system/core
Bug: http://b/154376560
Bug: https://bugs.llvm.org/show_bug.cgi?id=45594
Test: VM boots
Change-Id: I681c4c46503aff65f32a22c9da15397a42b67183
Bug: 151896491
Test: local build
Exempt-From-Owner-Approval: This CL moves all tests in vts-core to vts.
It won't change test logic or behavior.
Change-Id: I24779951257ce37fc18929f214d3cf5f76c23a19
Merged-In: I24779951257ce37fc18929f214d3cf5f76c23a19
Bug: 151896491
Test: presubmit check
Exempt-From-Owner-Approval: This CL renames suite name vts-core to vts.
It won't change test logic or behavior.
Change-Id: I24779951257ce37fc18929f214d3cf5f76c23a19
For currently unknown reasons, sideloading is broken with
libadbd_services as a cc_library_static.
Partial revert of commit a9b62d5452.
Bug: http://b/151056300
Test: xunchang@ tested manually
Change-Id: Iaffad9c476ba0adcffc5db512ba4a7ee0fb5cb22
(cherry picked from commit 7f8a37c8c7)
For currently unknown reasons, sideloading is broken with
libadbd_services as a cc_library_static.
Partial revert of commit a9b62d5452.
Bug: http://b/151056300
Test: xunchang@ tested manually
Change-Id: Iaffad9c476ba0adcffc5db512ba4a7ee0fb5cb22
The marked library(ies) were available to the APEXes via the hand-written
whitelist in build/soong/apex/apex.go. Trying to remove the whitelist
by adding apex_available property to the Android.bp of the libraries.
In this change, following libs were made available to all apexes because
their usage is quite common and there is no reason to restrict them
to some APEXes.
* libbase_headers
* libcutils, libcutils_headers
* libutils_headers, libsystem_headers
* liblog_headers
* libbacktrace, libbacktrace_headers
* libcrypto_utils
Bug: 150999716
Test: m
Change-Id: If3d3652e6604ed4f6d7694fe7ac61ae496621026
Long overdue clean up; there is no reason to include fs_config.h in
android_filesystem_config.h, and the fact that it causes problems if
it's done, necessitating EXCLUDE_FS_CONFIG_STRUCTURES to exist, is a
good reason to fix it.
Bug: 149785767
Test: build
Change-Id: I5ba2541cd1045c22486140649c90db39163081fd
* changes:
Properly remove adb DNS services.
adbd: fix build breakage.
adbd: remove static dependency on libcutils.
incremental_server: fix a use of uninitalized memory
We were previously statically linking libcutils into adbd for several
different reasons, which were addressed as follows:
socket functions: extracted to a statically linked libcutils_network
fs_config: wrapped with a shared library on /system
ATRACE: deleted the single use in adbd
Bug: http://b/150032044
Test: treehugger
Change-Id: I821fa174cfcbfa8e29a4be10de4016b817adbaf8
Merged-In: I821fa174cfcbfa8e29a4be10de4016b817adbaf8
(cherry picked from commit a9b62d5452)
We were previously statically linking libcutils into adbd for several
different reasons, which were addressed as follows:
socket functions: extracted to a statically linked libcutils_network
fs_config: wrapped with a shared library on /system
ATRACE: deleted the single use in adbd
Test: treehugger
Change-Id: I821fa174cfcbfa8e29a4be10de4016b817adbaf8
These will be used for quota tracking on external storage devices
that don't have sdcardfs.
Bug: 146419093
Test: N/A
Change-Id: If00961cc3807bcc3e93675e5d27dd6444007fdba
Helps with support of recovery and rollback boot reason history, by
also using /metadata/bootstat/persist.sys.boot.reason to file the
reboot reason.
Test: manual
Bug: 129007837
Change-Id: Id1d21c404067414847bef14a0c43f70cafe1a3e2
tracefs will be mounted at /sys/kernel/tracing when debugfs
is not mounted.
Bug: 134669095
Test: atest AtraceHostTest
Change-Id: I8178babaa6928ac3796622bdb08f123428ccd191
These will be used as a GID for the Android/data and Android/obb
directories respectively, on devices that don't have sdcardfs.
Bug: 146419093
Test: builds
Change-Id: I52a3235e872eb4b0402f918d5c47661f16626ba6
When debugfs is not mounted, atrace should look for
tracefs in /sys/kernel/tracing.
Test: CtsAtraceHostTestCases
Bug: 148436518
Change-Id: I45c0e664892bcda277fd9612106ad5216aea0a1b
This gid allows processes full access to public areas of external
storage. This includes the following:
1. EmulatedVolumes: All files and directories excluding the app
specific directories under Android/
2. PublicVolumes: Including 'unreliable' volumes (USB OTG) that are
not typically accesible to ordinary apps
Apps with the MANAGE_EXTERNAL_STORAGE permission will automatically
have this gid
Test: m
Bug: 144914977
Change-Id: I17da0b2367e356edc031d063e214574463afc985
Create KernelLibcutilsTest and add it to vts-core.
VtsKernelLibcutilsTest just run the test of libcutils_test_static
and filter-out all of the test except AshmemTest#. We can just use the
include-filter to do the same thing.
Bug: 147789274
Test: atest KernelLibcutilsTest
Change-Id: Idb5cee3596bf063c2419f1a11055a17ad3075e26
The credstore system daemon is running as an unprivileged user. This
CL adds this user and also creates a directory (/data/misc/credstore/)
where this daemon can store its data.
Bug: 111446262
Test: N/A
Change-Id: I8da2c32dd04fef797870b8a7bbc5e499bed71f9e
For a Q APEX built with use_vendor, rather than using AIDL to talk to
ashmemd, it would directly open /dev/ashmem. R libcutils does ashmem
differently, but in order to allow R-built APEXes to replace this
category of APEXes, falling back to /dev/ashmem.
Fixes: 147363115
Test: tested on Q in swcodec APEX
Change-Id: I625e46b15fee6649251ab9be7a1bbe11c5427525
This is to deprecate the sysprop change notification in atrace.
After this change, processes will only update their enabled tags
at the first atrace event. Previously we reloaded the tags as a
result of the sysprop changed Binder notification, which woke up
every process in the system.
Test: adb shell su root atrace -t 10 ss
Test: #define ATRACE_SHMEM 0; adb shell su root atrace -t 10 ss
Bug: 137366208
Change-Id: Idffba5fd4ba23fba2f6b9f594365df68ac0c1626
SurfaceFlinger requires CAP_SYS_NICE which is set in
libcutils/fs_config.cpp. This is the old way of setting capabilities
and new the way is to set it directly on surfaceflnger.rc
Test: adb shell /data/nativetest64/SurfaceFlinger_test/SurfaceFlinger_test
Test: adb shell stop surfaceflinger && adb shell start surfaceflinger
Bug: 147271477
Change-Id: I680509a385928a9c929d4fe4857118af219e2b13
Flattened APEXes can be installed in /system_ext.
Especially, GSI have both flattened/unflattened apexes so that it can
run with updatable devices and non-updatable devices as well.
Bug: 145963716
Test: flash GSI on P device and boot
Change-Id: I3a941672446a5353517243a851739a66f4252617
We're never going to fix this warning and it's not causing any active
issues that vendors are using this header. It is however causing
active issues that we have extraneous warning messages in the log.
Bug: 123758136
Test: no build warnings from <cutils/log.h>
Change-Id: Iccf702bf2536ba106a00ac04467d54401cbe2a50
Use TEMP_FAILURE_RETRY() for recvmsg() to prevent failing
unnecessarily from EINTR. Use PLOG(ERROR) in ueventd to display the
actual error if reading from the uevent socket does fail.
Test: build
Change-Id: I64a22698ce6ffc7573f75b57803551c7b6940e30
Setting executable bit on system_ext/bin is missing, so add them into
list.
Bug: 144066307
Test: m && check if system_ext/bin/* have execute permission.
Change-Id: I89c9e0d2d54f965ecd058bb9e77ba77b7ed164c1
Update fs_config tests for the new behavior in
a8eb00720c.
Before the above CL, fs_config_cmp() would match any partition prefix
to any path, even if there is not a logical relationship between them.
For example, these two lines in the test the demonstrate the changed
behavior:
{ true, "vendor/lib", "system/vendor/lib/hw", true },
{ true, "system/vendor/lib", "vendor/lib/hw", true },
The first line should match and does; it is testing that files located
at system/vendor/lib/hw are matched by an fs_path_config entry
specified as vendor/lib. This is to allow for applying the policy we
have for the vendor partition to files in /system/vendor in the case
that there is no vendor partition.
The second line should not match. This is testing that a file
that's located at vendor/lib/hw is matched by an fs_path_config entry
specified as system/vendor/lib. This is backwards; we do not want to
have policy specified for system/vendor to impact policy for the
vendor partition.
Also, we never have any relationships from /system/oem to /oem or
/system/odm to /odm, so these are logically unrelated and should fail
to match. We do however have a relationship from /vendor/odm to /odm,
so this test is added.
Test: libcutils unit tests pass on CF
Change-Id: I026f0233e00bbd0aad9bc0fb701aef000d2a037c
This reverts commit 5f8162b086.
Reason for revert: Turns out they're being used.
Merged-In: Iad9010190c7a4140b69dc553df5debdd88dcf81a
Change-Id: Iad9010190c7a4140b69dc553df5debdd88dcf81a
These functions and headers were all mistakenly added to the vndk.
They should not be used by vendors.
Test: these symbols do not appear in vendor libraries
Merged-In: I03919b437c2d9f0e573b7a6b40249ed12fe874b9
Change-Id: I03919b437c2d9f0e573b7a6b40249ed12fe874b9
Expose API to return name of task profile for cpuset/sched policy so
that libprocessgroup clients using SetTaskProfiles directly don't have
to maintain the mapping. This reduces the risk of inconsistency and saves
memory.
Bug: 139521784
Test: atest libcutils_test:SchedPolicy
Change-Id: I414312a038613913fb6a827bdcefceb3dec21264
This change is part of a topic that moves the recovery resources from the
system partition to the vendor partition, if it exists, or the vendor directory
on the system partition otherwise. The recovery resources are moving from the
system image to the vendor partition so that a single system image may be used
with either an A/B or a non-A/B vendor image. The topic removes a delta in the
system image that prevented such reuse in the past.
The recovery resources that are moving are involved with updating the recovery
partition after an update. In a non-A/B configuration, the system boots from
the recovery partition, updates the other partitions (system, vendor, etc.)
Then, the next time the system boots normally, a script updates the recovery
partition (if necessary). This script, the executables it invokes, and the data
files that it uses were previously on the system partition. The resources that
are moving include the following.
* install-recovery.sh
* applypatch
* recovery-resource.dat (if present)
* recovery-from-boot.p (if present)
This change moves the recovery resources to vendor in libcutils/fs_config.cpp
and removes the flash_recovery service from rootdir/init.rc. This service moved
to a vendor init.rc file in bootable/recovery/applypatch.
Bug: 68319577
Test: Ensure that recovery partition is updated correctly.
Change-Id: I492f7989ea8042912e9d0e0eadeaa351affbee13
Having libcutils ask ashmemd for ashmem fds results in unsatisfactory
performance/memory overhead. Introduce a duplicate of /dev/ashmem and
route to it instead.
Our goal remains as before, namely, use SELinux to phase out usage of
ashmem that doesn't go through libcutils.
Bug: 139855428
Test: boot aosp_crosshatch, browse internet, use camera
Change-Id: I02260a9042acb412571b11f1f4c1d8608483064a
This reverts commit aa96e8898c.
Reason for revert: It caused BB, and b/139257138 is for your reference
Change-Id: I93f1d0ba0fa43325e2815e9b2de84bb7cb41c457