summaryrefslogtreecommitdiff
path: root/libc
AgeCommit message (Collapse)Author
2021-04-06Fix return type of process_madvise().Elliott Hughes
Noticed this from https://man7.org/linux/man-pages/man2/process_madvise.2.html but independently confirmed by checking the kernel source. Also fix the documentation. Test: treehugger Change-Id: I6beeeeb2178a58a22a36532e634917b3ae8767ee
2021-04-06Merge "Reset PAC keys on thread creation instead of on zygote fork."Peter Collingbourne
2021-04-07Initialize _nres only onceLuke Huang
Currently, the initialization of _nres is not thread-saferes_mkquery is not thread-safe, which might cause memory double free problem if caller ran under multithread. To fix it, only initialize _nres once. Also remove the redundant code. Test: atest DnsResolverTest Bug: 166235340 Change-Id: I9caa6eab37cb530fc60dae9bcca9650973a4536a
2021-04-05setjmp/longjmp: avoid invalid values in the stack pointer.Elliott Hughes
arm64 was already being careful, but x86/x86-64 and 32-bit ARM could be caught by a signal in a state where the stack pointer was mangled. For 32-bit ARM I've taken care with the link register too, to avoid potential issues with unwinding. Bug: http://b/152210274 Test: treehugger Change-Id: I1ce285b017a633c732dbe04743368f4cae27af85
2021-04-02Merge "Match 'Access denied finding property' log severity to SELinux"Tom Cherry
2021-04-01Match 'Access denied finding property' log severity to SELinuxTom Cherry
This log message exists to provide more context (the property name) to SELinux denials for the same access check. The SELinux log severity is 'W' since SELinux denials do not necessarily point to user-visible errors, therefore this message should be 'W' as well. Bug: 181269159 Test: build Change-Id: Ie25091d96214a175b7ca39d5615f9a09b789d1e3
2021-03-30Merge "fortify: mark all always_inline functions with no_stack_protector"George Burgess IV
2021-03-29fortify: mark all always_inline functions with no_stack_protectorGeorge Burgess IV
FORTIFY'ed functions try to be as close to possible as 'invisible'; having stack protectors detracts from that. Don't apply this to functions which clang has no chance of inlining anyway (like variadic functions) Bug: 182948263 Test: TreeHugger Change-Id: I08cfec25464b8ea1e070942e3dc76fc84da73dd0
2021-03-29Merge SP1A.210329.001Scott Lobdell
Change-Id: Ie1f9593a171a968cfc1b44967409feb7b13a21b1
2021-03-25Reset PAC keys on thread creation instead of on zygote fork.Peter Collingbourne
Resetting PAC keys on fork appears to lead to a number of problems. One problem is that we are constrained in where we can run C++ code after forking, and with ART those places are implementation-defined. For example, in app zygotes, ART turns out to insert "interpreter frames" in the stack trace. Returning into these interpreter frames may lead to crashes due to failing the ROP protection check on return. It seems better to reset keys on thread creation instead. We only need to reset IA because only this key needs to be reset for reverse-edge PAC, and resetting the other keys may be incompatible with future ABIs. Chrome (and potentially other applications) has a sandbox that prevents the use of the prctl, so we restrict its use to applications targeting S and above. Bug: 183024045 Change-Id: I1e6502a7d7df319d424e2b0f653aad9a343ae71b
2021-03-19bp2build: remove some bp2build_available props, use package_allowlist instead.Jingwen Chen
Test: build/bazel/scripts/milestone-2/demo.sh full Test: bazel query //bionic/... Change-Id: I737574766be898279d8bf6f3f0adb43dcc40c220
2021-03-18Merge "Update kernel update documentation."Christopher Ferris
2021-03-18Merge "Remove __stack_chk_fail_local() completely."Treehugger Robot
2021-03-18Update kernel update documentation.Christopher Ferris
Parts of the document have gone out of date, so update it. Test: NA Change-Id: Ia4bc534ca1cc9a538d5995126c541c2cd7029c57
2021-03-17Merge "scandir: remove dead code."Treehugger Robot
2021-03-17Remove __stack_chk_fail_local() completely.Elliott Hughes
As far as I can tell, clang never implemented this GCC workaround for 32-bit x86's terrible PIC code. Since the whole point of __stack_chk_fail_local() requires that it's in the same executable or library as its callers, any prebuilt with a dependency on this (because it was built by GCC) already has its own copy anyway. And clang isn't creating any new ones, so I think this has been dead for several years now. Test: treehugger Change-Id: I96997bbf912bbff506db44c285d9941fef9f86ce
2021-03-16Clean up __stack_chk_fail_local slightly.Elliott Hughes
Motivated by the fact that bazel doesn't like #include "../", but this feels like it could use a deeper clean. In fact, even after this change, I think we should remove this entirely, since as far as I can tell Clang never implemented this GCC workaround for 32-bit x86's awful PIC code. Test: treehugger Change-Id: I72715ee46f873f42d5707712aebe246ef78fcde1
2021-03-16scandir: remove dead code.Elliott Hughes
This is the second or third time I've scratched my head wondering why this destructor has no coverage. I was tempted to leave it in with a comment saying it should never be called, but that seemed sillier than just replacing it with an assertion. Test: treehugger Change-Id: I3442d9f8a391fae668e77c6888a4457ededee494
2021-03-16Merge "Remove bazel_module.label from bionic genrules"Liz Kammer
2021-03-16Merge "Depend on libasync_safe module instead of breaking package boundary."Treehugger Robot
2021-03-16Merge "Add missing includes for crtend modules"Liz Kammer
2021-03-16Depend on libasync_safe module instead of breaking package boundary.Rupert Shuttleworth
This makes Bazel conversion easier (because in Bazel package boundaries really matter). Test: m libc still builds, and m also builds. Change-Id: I5cfc9d83dffd3110ffad9ce03198e6141c8c5b33
2021-03-15Add missing includes for crtend modulesLiz Kammer
Test: convert bp2build_available targets to BUILD and bazel build --platforms=//build/bazel/platforms:generic_arm64 //bionic/... Change-Id: I1cbdbf1d65d7dbe95665aaac08004c80f82433e9
2021-03-15Merge "Mark MTE elf notes as sdk_version to allow SDK linkage."Mitch Phillips
2021-03-15Merge "Merge crt cc_objects"Liz Kammer
2021-03-11Add userfaultfd syscall in SECCOMP allowlistLokesh Gidra
Enable userfaultfd syscall to be used by ART-GC. Bug: 160737021 Test: manually tested by invoking userfaultfd syscall in ART Change-Id: I9f98402a96bb8363a1e5fa49dbadbb37dc70d561
2021-03-11Merge SP1A.210311.001Scott Lobdell
Change-Id: Ibc8a477237696d23ba36573c5b0334a0b1007865
2021-03-11Merge "Teach debuggerd to pass the secondary ring buffer to ↵Peter Collingbourne
__scudo_get_error_info()."
2021-03-10Merge crt cc_objectsLiz Kammer
Currently there is a pattern of `crtbegin_${type}1` and `crtbegin_${type}` modules, where the former has sources and the latter depends on the former. The two modules for a type share many properties, rather than duplicating these, we merge modules, such that each type only has a `crtbegin_${type}` module. Test: Treehugger Change-Id: I7803ea0e97d660f620c334b6bfdfac22cb6e36d7
2021-03-09Merge "Add min_sdk_version for ART module."Nicolas Geoffray
2021-03-09Merge "Add some slack at the end of large allocations when target SDK level ↵Peter Collingbourne
< S."
2021-03-08Improve <sys/xattr.h> coverage.Elliott Hughes
Also fix a comment copy & paste mistake and some formatting. Test: treehugger Change-Id: I0af3ab2eb4f180f86b0ab7d2af260f0f30692fdd
2021-03-08Add min_sdk_version for ART module.Nicolas Geoffray
Bug: 180399951 Test: m Change-Id: I54eb06ae4a695ae184de4fb72fc0092910836652
2021-03-05Add some slack at the end of large allocations when target SDK level < S.Peter Collingbourne
This works around buggy applications that read a few bytes past the end of their allocation, which would otherwise cause a segfault with the concurrent Scudo change that aligns large allocations to the right. Because the implementation of android_set_application_target_sdk_version() lives in the linker, we need to introduce a hook so that libc is notified when the target SDK version changes. Bug: 181344545 Change-Id: Id4be6645b94fad3f64ae48afd16c0154f1de448f
2021-03-03Mark MTE elf notes as sdk_version to allow SDK linkage.Mitch Phillips
Binaries defined in Makefiles that use the SDK need a variant to link to. Generate a SDK variant of the ELF note as well. This is necessary to allow makefile-generated binaries and CTS tests to use heap MTE. Bug: 156029370 Bug: 181133973 Test: atest CtsBionicTestCases on QEMU+MTE, observe previously-failing tests will now succeed. Change-Id: I0a8243b0920769a196e7596904259e30c4a93105
2021-03-03Remove unused (and empty) file.Elliott Hughes
Spotted while looking at our shiny new coverage numbers. Though how the change that removed the code from this file without removing the file made it through code review... Clearly I wasn't paying attention that day! Test: treehugger Change-Id: Id61bb48bae60660d2e5ba9b26f00a68e51157c6d
2021-03-03Remove bazel_module.label from bionic genrulesLiz Kammer
Mixed builds can now use the label from an automatically converted target. Test: build/bazel/scripts/milestone-2/demo.sh full Test: build/bazel/scripts/milestone-2/demo.sh generate build/bazel/scripts/milestone-2/demo.sh sync mixed build of libc build/bazel/scripts/milestone-2/demo.sh cleanup Change-Id: I1499b75f1348bf342b4cd134606786150b2f8b26
2021-03-01Merge "Add wrappers for pidfd_{open,getfd,send_signal}."Josh Gao
2021-02-26Merge "Add additional app to netlink appcompat allowlist."Bram Bonné
2021-02-26Add additional app to netlink appcompat allowlist.Bram Bonné
Bug: 180726036 Test: Confirm app no longer errors at start Change-Id: I9f1c99a13bbfb8dbdf977d52c67a64d400fd9821
2021-02-25Add wrappers for pidfd_{open,getfd,send_signal}.Josh Gao
Bug: http://b/172518739 Test: `/data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_filter="*pidfd*"` on blueline Change-Id: Ibae32bbedbcf26535a80a5cbfb55ce180906b610
2021-02-25Merge "Make libc genrules and its tool dep bp2build_available"Christopher Parsons
2021-02-24Make libc genrules and its tool dep bp2build_availableChris Parsons
Test: lunch aosp_flame && USE_BAZEL_ANALYSIS=1 m libc Test: lunch aosp_flame && USE_BAZEL_ANALYSIS=1 m crtbegin_so1 Change-Id: I12380ef9294f8b7c3b00ea700d804c1abde7ad04
2021-02-24bp2build: convert more cc_objectsJingwen Chen
This is the last of remaining cc_objects in the libc package. Test: go tests. Test: build/bazel/scripts/milestone-2/demo.sh Change-Id: Ib9c01be0faae10707305b81e72d3fac22bf96356
2021-02-24Merge "Make __libc_init_scudo() weak for native bridge."Treehugger Robot
2021-02-23Make __libc_init_scudo() weak for native bridge.Peter Collingbourne
__libc_init_scudo() calls directly into the allocator, bypassing the normal guest to host transition in the native bridge. Therefore we need to let the native bridge override it with a no-op. Bug: 159352723 Change-Id: I642c7a058e483cc09335290f66b9c053150fca06
2021-02-23Merge SP1A.210222.001Scott Lobdell
Change-Id: I0c63fcf0268c45f5f90323df42aaf2f77e05abdb
2021-02-22bp2build: mark filegroups as bp2build_available.Jingwen Chen
Test: build/bazel/scripts/milestone-2/demo.sh Change-Id: Ife199b1860521c55baa96cadc42bd021556c62cd
2021-02-21Merge "Add LOCAL_LICENSE_KINDS to bionic"Bob Badour
2021-02-20Merge "bp2build: convert more cc_objects."Jingwen Chen