aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2 daysMerge "Update the _FORTIFY_SOURCE documentation." into mainHEADmastermainTreehugger Robot
2 daysMerge "Add deprecation message for __sF." into mainTreehugger Robot
2 daysMerge "Allow deprecation messages." into mainTreehugger Robot
3 daysAdd deprecation message for __sF.Dan Albert
Bug: None Test: treehugger Change-Id: I9dd9e77ad024c2ea292f021bb2709378f755c1d8
3 daysAllow deprecation messages.Dan Albert
I'll land another patch that makes this required once I've fixed up all the callers. Bug: https://github.com/android/ndk/issues/2014 Test: treehugger Change-Id: I62b9fdd3174f37d33f01c27f7f4e9134f6d9df6e
3 daysMerge changes from topic "pgsize_compat_loader" into mainKalesh Singh
* changes: bionic: loader: Drop readahead padding pages loader: Only extend segments if kernel supports page size migration bionic: loader: Don't extend LOAD segments for p_aligns > 64KiB
3 daysUpdate the _FORTIFY_SOURCE documentation.Elliott Hughes
Change-Id: Icc73673b792dbc1a20ed70561a461e1fc47b2d6b
3 daysMerge "Remove historical cruft." into mainTreehugger Robot
3 daysbionic: loader: Drop readahead padding pagesKalesh Singh
These are padding pages are only needed to layout the ELF to be compatible with max-page-size. They are zero-filled (holes) and can be dropped from the page cache. The madvise() here is a special case that also serves to hint to the kernel what part of the segment is padding. For example the kernel then shows these padding regions as PROT_NONE VMAs (labeled [page size compat]) in /proc/*/maps. Note: This doesn't use backing vm_area_structs, so doesn't consume additional slab memory. Before: ❯ cf-adb shell cat /proc/1/maps | grep -A1 'libbase.so$' 7f8d13600000-7f8d13614000 r--p 00000000 fe:09 21909460 /system/lib64/libbase.so 7f8d13614000-7f8d13638000 r-xp 00014000 fe:09 21909460 /system/lib64/libbase.so 7f8d13638000-7f8d1363c000 r--p 00038000 fe:09 21909460 /system/lib64/libbase.so 7f8d1363c000-7f8d1363d000 rw-p 0003c000 fe:09 21909460 /system/lib64/libbase.so Segments appear extended in /proc/<pid>/maps After: ❯ cf-adb shell cat /proc/1/maps | grep -A1 'libbase.so$' 7f3650043000-7f3650054000 r--p 00000000 fe:09 21906900 /system/lib64/libbase.so 7f3650054000-7f3650057000 ---p 00000000 00:00 0 [page size compat] 7f3650057000-7f3650079000 r-xp 00014000 fe:09 21906900 /system/lib64/libbase.so 7f3650079000-7f365007b000 ---p 00000000 00:00 0 [page size compat] 7f365007b000-7f365007c000 r--p 00038000 fe:09 21906900 /system/lib64/libbase.so 7f365007c000-7f365007f000 ---p 00000000 00:00 0 [page size compat] 7f365007f000-7f3650080000 rw-p 0003c000 fe:09 21906900 /system/lib64/libbase.so Segments maintain PROT_NONE gaps ("[page size compat]") for app compatiblity but these are not backed by actual slab VMA memory. Bug: 330117029 Bug: 327600007 Bug: 330767927 Bug: 328266487 Bug: 329803029 Test: Manual - Launch Free Fire Chaos app Change-Id: Ic50540e247b4294eb08f8cf70e74bd2bf6606684 Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
3 daysloader: Only extend segments if kernel supports page size migrationKalesh Singh
It has been found that some existing apps have implicit dependencies on the address ranges in /proc/*/maps. Since segment extension changes the range of the LOAD segment VMAs some of these apps crash, either by SIGBUS or in yet unidentified ways. Only perform the segment extension optimization if the kernel has the necessary mitigations to ensure app compatibility. Bug: 330117029 Bug: 327600007 Bug: 330767927 Bug: 328266487 Bug: 329803029 Test: Manual - Launch Free Fire Chaos app Change-Id: I5b03b22c4a468f6646750a00942cc2d57f43d0de Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
3 daysMerge "__system_property_add: log specifics about failures." into mainTreehugger Robot
3 daysbionic: loader: Don't extend LOAD segments for p_aligns > 64KiBKalesh Singh
Loader segment extension was introduced to fix kernel slab memory regressions in page-agnostic Android. This reression was due to required VMAs for the gap VMAs that exist when the elf-max-page-size > runtime-page-size. This issue already existed for some libraries like libart.so and libhwui.so which use 2mB alignment to make use of THPs (transparent huge pages). Later it was found that this optimization could break in-field apps due to dependencies and the address ranges in /proc/*/[s]maps. To avoid breaking the in-field apps, the kernel can work around the compatibility issues if made aware of where the padding regions exist. However, the kernel can only represent padding for p_align up to 64KiB. This is because the kernel uses 4 available bits in the vm_area_struct to represent padding extent; and so cannot enable mitigations to avoid breaking app compatibility for p_aligns > 64KiB. For ELFs with p_align > 64KiB, don't do segment extension, to avoid issues with app compatibility -- these ELFs already exist with gap mappings and are not part of the page size transition VMA slab regression. Bug: 330117029 Bug: 327600007 Bug: 330767927 Bug: 328266487 Bug: 329803029 Test: Manual - Launch Free Fire Chaos app Change-Id: Id4dcced4632dce67adab6348816f85847ce1de58 Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
3 days__system_property_add: log specifics about failures.Elliott Hughes
Failure to add a property should be rare, so log the specific failure to aid in debugging. Bug: http://b/322714325 Change-Id: I9461428f16d7d04d5aceb910a5cf1c928cfe9da2
3 daysRemove historical cruft.Elliott Hughes
We're definitely on a new enough clang now... Change-Id: I7ec4ad0e78872edbde05a31574dd78f219bb115c
4 daysMerge "16k: bionic: Replace hardcoded page size with getpagesize()" into mainTreehugger Robot
4 days16k: bionic: Replace hardcoded page size with getpagesize()Vilas Bhat
The optional block size for the /proc filesystem is set to page size. The tests must reflect the same. Bug: 315510913 Change-Id: Ifccf833829b4ea4ff9c7d375208124cdc43af04a
5 daysMerge "Make "remapping stacks as PROT_MTE" debug log" into mainFlorian Mayer
5 daysMake "remapping stacks as PROT_MTE" debug logFlorian Mayer
This was spamming logcat Change-Id: I3255b583d594a91faae8680aaef94d793c3c26a9
5 daysMerge "Upstream sync." into mainElliott Hughes
5 daysUpstream sync.Elliott Hughes
Also clean up some obsolete cruft from openbsd-compat.h... Test: treehugger Change-Id: I9eae0f8304e701d032045617427289002d234cd8
6 daysMerge "[scudo] -1 is also valid for M_DECAY_TIME" into mainTreehugger Robot
8 days[scudo] -1 is also valid for M_DECAY_TIMEChia-hung Duan
Test: Run tests Change-Id: I044ef84bf0ec97c0f8cb8d3a2340b82218d85efc
9 daysMerge "[RISC-V] Add misaligned load store tests" into mainAditya Kumar
9 daysMerge "get_executable_info: minor clarification." into mainElliott Hughes
9 daysMerge "Revert "Switch the loader to a noexcept version of libc++"" into mainRyan Prichard
9 daysRevert "Switch the loader to a noexcept version of libc++"Ryan Prichard
Revert submission 2675705-use-prebuilt-libcxx Reason for revert: breaks some Android tests (b/337120479, b/337121737, b/337122511) Reverted changes: /q/submissionid:2675705-use-prebuilt-libcxx Bug: 337120479 Bug: 337121737 Bug: 337122511 Change-Id: Ic5256fb1b4f09967ec29f36d8bdf96a16649ca05
9 days[RISC-V] Add misaligned load store testsAdityaK
hwprobe test may be insufficient to guarantee fast (or even supported) unaligned access. Test case based on: https://github.com/llvm/llvm-project/issues/88029 Previous commit got reverted due to compiler errors(b/336800888). Not sure why the errors were not detected in pre-submit builds. Bug: https://github.com/google/android-riscv64/issues/142 Change-Id: If1c4150701298c0f351baa9ce1870509a00c250a
10 daysMerge "Switch the loader to a noexcept version of libc++" into mainRyan Prichard
10 daysget_executable_info: minor clarification.Elliott Hughes
Change the comment to explain _why_ we're resolving the path, get rid of unnecessarily explicit strlen() calls, and make it clearer that result.path is unconditionally initialized; it's just the specific content that varies. Change-Id: Iffbd5efc2eafd56e3efa3c0aaf7c191e6bb66a04
10 daysMerge "linker: use realpath instead of readlink when getting the symlink ↵Treehugger Robot
path" into main
10 daysMerge "Only try to initialize appcompat properties if the folder is present" ↵Treehugger Robot
into main
11 daysMerge "Revert "[RISC-V] Add misaligned load store tests"" into mainPrashanth Swaminathan
11 daysRevert "[RISC-V] Add misaligned load store tests"Prashanth Swaminathan
This reverts commit 4250342124ace8fb924cb1768e105ea64d433e0e. Reason for revert: b/336800888, broke RISC-V build. Change-Id: I8102bb0c20f80153b97853e5c988add31d4693fc
11 daysMerge "[RISC-V] Add misaligned load store tests" into mainAditya Kumar
12 days[RISC-V] Add misaligned load store testsAdityaK
hwprobe test may be insufficient to guarantee fast (or even supported) unaligned access. Bug: https://github.com/google/android-riscv64/issues/142 Bug: https://github.com/llvm/llvm-project/issues/88029 Change-Id: Ib673c5b752da8630296926e5ec7f59f41b686016
12 daysMerge "Always use `__foo__` for attribute names." into mainElliott Hughes
12 daysMerge "Replace commented-out deprecated attribute with doc comment." into mainTreehugger Robot
12 daysMerge "__system_property_set: add string names for init's error codes." into ↵Elliott Hughes
main
12 days__system_property_set: add string names for init's error codes.Elliott Hughes
https://issuetracker.google.com/336223505 is not the first hard-to-read bug here. Change-Id: I520aeb2cb87423f8db394bf4709d659e3eb3a309
13 daysReplace commented-out deprecated attribute with doc comment.Elliott Hughes
This attribute had been commented out since it was first committed a decade ago. No-one's going to chase down arm32-only trivia like that before arm32 and x86 are removed as obsolete... Change-Id: I8e29d16657b3f4ce379e65732d747f969ea31dae
13 daysAlways use `__foo__` for attribute names.Elliott Hughes
To avoid collisions with other macros. Change-Id: I015639043deaceccaf5f11365f8bdc45ca703da5
13 dayslinker: use realpath instead of readlink when getting the symlink pathchenxinyuanchen
Fix the issue if link for an symlink that point to an relative path cause the linker can not find the right absolute path. For example: lrwxr-xr-x 1 root shell 13 2009-01-01 08:00 /system/bin/app_process -> app_process64 the '/system/bin/app_process' is symlinked to 'app_process64' and will be failed. if the 'exe_to_load' is null and also failed when stat '/proc/self/exe' will entered this path. Without Patch: [ Linking executable "app_process64" ] linker: CANNOT LINK EXECUTABLE "/system/bin/app_process": library "libnativeloader.so" not found: needed by main executable With Patch: [ Linking executable "/system/bin/app_process64" ] [ Using config section "system" ] [ Jumping to _start (0x75593c3000)... ] Test: Manual - Run app_process (symlinked to app_process64) Change-Id: Iacd0a810a679e8d55d68d7e4c84f0e5e4f276b14 Signed-off-by: chenxinyuanchen <chenxinyuanchen@xiaomi.com> Signed-off-by: chenxinyuanchen <chenxinyuanchen@xiaomi.corp-partner.google.com>
2024-04-20Merge "Document pthread_key_create(3), pthread_key_delete(3), and ↵Elliott Hughes
PTHREAD_KEYS_MAX." into main
2024-04-19Only try to initialize appcompat properties if the folder is presentNate Myren
If the Init process doesn't write the appcompat system properties folder, do not attempt to initialize it Bug: 331307495 Test: manual (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d071e949a6153e76eb7c67e5947d4d387a8afe2d) Merged-In: I21716ea87e55a63a1b79127887c451d0fcf006f3 Change-Id: I21716ea87e55a63a1b79127887c451d0fcf006f3
2024-04-18Document pthread_key_create(3), pthread_key_delete(3), and PTHREAD_KEYS_MAX.Elliott Hughes
In particular "how to work around the PTHREAD_KEYS_MAX limit". Change-Id: I330936d598ddddfa0903f0505fd00f8fcbf02543
2024-04-18Merge "Update to v6.8 kernel headers." into mainChristopher Ferris
2024-04-18Merge "libc: remove __size_mul_overflow" into mainNick Desaulniers
2024-04-17libc: remove __size_mul_overflowNick Desaulniers
We should just be able to use __builtin_umull_overflow now, which expects unsigned long parameters. We don't need __builtin_umul_overflow (which expects unsigned ints) because Bionic is LP64 or ILP32, so for ILP32 sizeof(size_t) == sizeof(unsigned long), so __builtin_umull_overflow will work for either ILP32 or LP64. Test: mm Change-Id: I872491731bca05e561767f8bfeda4c6704e10ccb Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2024-04-17Merge "Use inline keyword without underscores consistently" into mainNick Desaulniers
2024-04-17Merge "Clean up __always_inline" into mainTreehugger Robot