Commit graph

11980 commits

Author SHA1 Message Date
Florian Mayer
a5d6778356 Change doc about crash_detail name
Test: none, doc change
Bug: 326097280
Change-Id: I5a79b8ac7448e564a9d72ad1c9323cea35d82227
2024-03-21 13:50:44 -07:00
Elliott Hughes
6cd03eff43 Update FreeBSD elf_common.h.
Looks like I'd been bad here, and added new stuff to this file rather
than <elf.h> directly. I've also done nothing to upstream any of this.
This patch at least addresses the former problem, moving our stuff out
into <elf.h>.

Rather than *delete* anything that conflicts with Linux in elf_common.h,
I've disable it with // or #if, and marked those as Android changes to
make it less likely that the next update accidentally drops them (which
isn't super likely, since most of them should actually cause build
failures when they conflict with uapi).

Test: treehugger
Change-Id: Id0deccc7305c60b0f708b55e2eed0dedc0bca41d
2024-03-21 20:13:36 +00:00
Ryan Prichard
439639268d Fix StaticTlsLayout for atypical alignment values
arm32/arm64: Previously, the loader miscalculated a negative value for
offset_bionic_tcb_ when the executable's alignment was greater than
(8 * sizeof(void*)). The process then tended to crash.

riscv: Previously, the loader didn't propagate the p_align field of the
PT_TLS segment into StaticTlsLayout::alignment_, so high alignment
values were ignored.

__bionic_check_tls_alignment: Stop capping alignment at page_size().
There is no need to cap it, and the uncapped value is necessary for
correctly positioning the TLS segment relative to the thread pointer
(TP) for ARM and x86. The uncapped value is now used for computing
static TLS layout, but only a page of alignment is actually provided:
 * static TLS: __allocate_thread_mapping uses mmap, which provides only
   a page's worth of alignment
 * dynamic TLS: BionicAllocator::memalign caps align to page_size()
 * There were no callers to StaticTlsLayout::alignment(), so remove it.

Allow PT_TLS.p_align to be 0: quietly convert it to 1.

For static TLS, ensure that the address of a TLS block is congruent to
p_vaddr, modulo p_align. That is, ensure this formula holds:

    (&tls_block % p_align) == (p_vaddr % p_align)

For dynamic TLS, a TLS block is still allocated congruent to 0 modulo
p_align. Fixing dynamic TLS congruence is mostly a separate problem
from fixing static TLS congruence, and requires changing the dynamic
TLS allocator and/or DTV structure, so it should be fixed in a
later follow-up commit.

Typically (p_vaddr % p_align) is zero, but it's currently possible to
get a non-zero value with LLD: when .tbss has greater than page
alignment, but .tdata does not, LLD can produce a TLS segment where
(p_vaddr % p_align) is non-zero. LLD calculates TP offsets assuming
the loader will align the segment using (p_vaddr % p_align).
Previously, Bionic and LLD disagreed on the offsets from the TP to
the executable's TLS variables.

Add unit tests for StaticTlsLayout in bionic-unit-tests-static.

See also:
 * https://github.com/llvm/llvm-project/issues/40872
 * https://sourceware.org/bugzilla/show_bug.cgi?id=24606
 * https://reviews.llvm.org/D61824
 * https://reviews.freebsd.org/D31538

Bug: http://b/133354825
Bug: http://b/328844725
Bug: http://b/328844839
Test: bionic-unit-tests bionic-unit-tests-static
Change-Id: I8850c32ff742a45d3450d8fc39075c10a1e11000
2024-03-20 17:01:35 -07:00
Elliott Hughes
526bd985c8 Include the SPDX identifiers in NOTICE files.
We're starting to see projects _only_ use the SPDX identifiers (and
they're more readable "at a glance" anyway), so it's probably time to
include these...

Test: N/A
Change-Id: I5c76d77dcd392a8db1166108e410389d349a42c3
2024-03-19 15:56:30 +00:00
Elliott Hughes
63df96b7fb Merge "crt*.o cleanup." into main 2024-03-14 18:37:18 +00:00
Treehugger Robot
f3a8ae87fd Merge "Ignore bionic versioning in vendor modules" into main 2024-03-14 03:35:13 +00:00
Elliott Hughes
6a30b71b07 crt*.o cleanup.
Say .S instead of .c in a comment, and don't add an include directory we don't need.

Change-Id: I4cfc39904a4ad67a2aadb6691c527f7e38d9c4c7
2024-03-13 23:41:32 +00:00
Florian Mayer
60573deb72 Merge "Move memtag_stack out of libc_globals" into main 2024-03-13 17:54:37 +00:00
Justin Yun
ced630225a Ignore bionic versioning in vendor modules
Vendor modules do not follow bionic versioning but define their own
versioning for LLNDK. Ignore the __INTRODUCED_IN annotation for
vendor modules.

Bug: 302113279
Test: build trunk-staging and next configurations
Change-Id: I04646b524d17f7ae47f0f96cb98f221f3e821629
2024-03-13 21:02:58 +09:00
Elliott Hughes
eb4cf41766 Add missing documentation to <dlfcn.h>.
All the dude wanted was to mention that dlclose() can cause problems with thread locals...

Change-Id: Iea23c49b6b2d6d93b85b2aa0ab1183e68cf39695
2024-03-12 23:45:00 +00:00
Florian Mayer
73750dc38e Move memtag_stack out of libc_globals
We cannot use a WriteProtected because we are accessing it in a
multithreaded context.

Test: atest memtag_stack_dlopen_test w/ MTE
Test: atest bionic-unit-tests w/ MTE
Test: atest bionic-unit-tests on _fullmte
Bug: 328256432
Change-Id: I39faa75f97fd5b3fb755a46e88346c17c0e9a8e2
2024-03-12 12:42:23 -07:00
Florian Mayer
5cc10a9a0d Merge "Make memtag_handle_longjmp precise" into main 2024-03-12 18:12:46 +00:00
Florian Mayer
0e1412e08e Make memtag_handle_longjmp precise
We would get the SP inside of memtag_handle_longjmp, which could prevent
us from detecting the case where a longjmp is going into a function that
had already returned. This changes makes the behaviour more predictable.

Change-Id: I75bf931c8f4129a2f38001156b7bbe0b54a726ee
2024-03-06 16:46:45 -08:00
Elliott Hughes
7c37e12827 Merge "Clarify the timespec argument to clock_nanosleep()." into main am: 70ecb746f3
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2987070

Change-Id: Ie84b92a2839ad09f5f73f1cce173df5a14e3e237
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-05 15:44:19 +00:00
Elliott Hughes
c2ce647e2a Merge "Consistently use 'op' in argument names." into main am: 47f8ab80cc
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2987969

Change-Id: Id162bd1a19777501ea982996f3689a22142e18e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-05 15:44:07 +00:00
Elliott Hughes
786484d808 Merge "_Fork(): clarify what not running pthread_atfork() handlers means in practice." into main am: 69bc81615b
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2987030

Change-Id: Ic3bcc3ec2addc60edf75d612eb4c5bd35f902040
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-05 15:43:53 +00:00
Elliott Hughes
70ecb746f3 Merge "Clarify the timespec argument to clock_nanosleep()." into main 2024-03-05 15:25:46 +00:00
Elliott Hughes
47f8ab80cc Merge "Consistently use 'op' in argument names." into main 2024-03-05 15:25:18 +00:00
Elliott Hughes
8dc9c1cad3 Clarify the timespec argument to clock_nanosleep().
Pointed out during review of a similar change to the man page.

Change-Id: I78f87bc4ff9fed773ca6f477e79f4a3fd507e056
2024-03-05 00:17:22 +00:00
Elliott Hughes
364fc76047 Consistently use 'op' in argument names.
This matches changes being made to regularize the man page terminology.

Change-Id: If949cf81a0a0a06f24a4a742e8bf45c53dbd0da1
2024-03-04 23:48:00 +00:00
Elliott Hughes
8257268d04 _Fork(): clarify what not running pthread_atfork() handlers means in practice.
Change-Id: I0546069bbef730ffc23b3cea90fe7280d905d885
2024-03-04 22:24:01 +00:00
Treehugger Robot
b4d8542a84 Merge "Correct the nullability annotation in posix_spawnattr_init()" into main am: 2c0e9a58ea
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2983453

Change-Id: Ib3fd19948abcb9f10e6ed4e4e2a9a16835c91c9a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-01 03:26:47 +00:00
Treehugger Robot
2c0e9a58ea Merge "Correct the nullability annotation in posix_spawnattr_init()" into main 2024-03-01 02:40:32 +00:00
Elliott Hughes
335380e79a Merge "Add _Fork()." into main am: a216b269ef
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2976351

Change-Id: I3292deb2184c7f88b39e2ee9d817775031bfbfb7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-29 23:29:07 +00:00
zijunzhao
148476d91c Correct the nullability annotation in posix_spawnattr_init()
The input __attr should be allowed to point to null.

Bugs: b/245972273
Test: adb shell
Change-Id: Id433d220e7c074ca68e2541371491975b33928ed
2024-02-29 22:55:00 +00:00
Elliott Hughes
a216b269ef Merge "Add _Fork()." into main 2024-02-29 22:25:45 +00:00
Elliott Hughes
2411fff9f2 Add _Fork().
POSIX issue 8 function, already in musl/glibc (but not iOS/macOS).

Bug: https://austingroupbugs.net/view.php?id=62
Test: treehugger
Change-Id: Id51611afdab92dff36a540b7d8737fc0e31f3d36
2024-02-29 20:50:58 +00:00
Treehugger Robot
91a073d442 Merge "Remove unnecessary includes" into main am: 9218876df0
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2983496

Change-Id: I5d0ed4bbda78c7989cf44c2fd0d5feb58b3319d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-29 16:38:03 +00:00
Treehugger Robot
9218876df0 Merge "Remove unnecessary includes" into main 2024-02-29 15:57:14 +00:00
Florian Mayer
5f177e3746 Remove unnecessary includes
Test: debuggerd_test, CtsCrashDetailHostTestCases
Change-Id: Iceb0458d953f23aff13576a45c2f6a616c40c1a5
2024-02-28 17:28:54 -08:00
Steven Moreland
d29e333562 Merge "Add ..DEPRECATED_PAGE_SIZE macro" into main am: 2215ad406b
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2978135

Change-Id: I436e26aa5e3587f5977854c4fdb720e0199a4b8d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-28 22:04:18 +00:00
Steven Moreland
2215ad406b Merge "Add ..DEPRECATED_PAGE_SIZE macro" into main 2024-02-28 21:34:56 +00:00
Steven Moreland
f6e9904fa9 Add ..DEPRECATED_PAGE_SIZE macro
When 'no page size' is turned on (especially if it is turned
on by default in some environments), we need a way to turn
it off, thus restoring the old behavior.

Bug: 312546062
Change-Id: I411cff621246b6ba40e70bb51234f3886ba9527a
Test: N/A
2024-02-28 21:34:42 +00:00
Treehugger Robot
0500d85da2 Merge "__bionic_get_shell_path(): explanatory comment." into main am: c3a6b446c4
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2978812

Change-Id: I4e4c1c7090e46bfc67bfe02f8ee3b63947675ead
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-27 19:51:17 +00:00
Elliott Hughes
529e624e2d __bionic_get_shell_path(): explanatory comment.
Change-Id: If7cb9ff4a3c13b80bb27da119bfb4c38137798a7
2024-02-26 23:08:06 +00:00
Elliott Hughes
7617af2274 Merge "Improve android_set_abort_message() documentation." into main am: dcfc4a1ccc
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2975871

Change-Id: I11be30ab4fa04875304fbfb74b88edf819613c85
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-26 21:40:04 +00:00
Elliott Hughes
94c93d659b Improve android_set_abort_message() documentation.
Change-Id: Iee01fcfc39356f3daeb0676acc0dc0dd17675e68
2024-02-23 17:41:55 +00:00
Treehugger Robot
de24241803 Merge "Mention ApplicationExitInfo in docs" into main am: 6835b71819
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2974831

Change-Id: Ib3abeeaa14f06650721fac0504ca23431fad2c42
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-23 05:29:51 +00:00
Florian Mayer
63df50e101 Mention ApplicationExitInfo in docs
Bug: 155462331
Change-Id: I2a60dc1ca5a117bd47631dc7faba8446b4518761
2024-02-23 01:34:22 +00:00
Elliott Hughes
00fa3f3083 Merge "Clean up the <netinet/ether.h> implementation." into main am: 9a7da857a7
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2966403

Change-Id: I21579d147afd2f4cac41654ae627c9a190da2917
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-22 16:08:38 +00:00
Elliott Hughes
b904f6d982 Merge "Stop trying to be clever with sysconf(_SC_NGROUPS_MAX)." into main am: 85164759f7
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2972452

Change-Id: Id5b120f60171bc23be25a561356bb14769c5e01f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-22 16:08:28 +00:00
Elliott Hughes
0514c95667 Merge "Clarify _PC_REC_INCR_XFER_SIZE and _PC_REC_MAX_XFER_SIZE." into main am: ea8be9ff96
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2971213

Change-Id: I7774d4c92da81545b7c0a758107e19c48089cd9e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-22 16:08:17 +00:00
Elliott Hughes
9a7da857a7 Merge "Clean up the <netinet/ether.h> implementation." into main 2024-02-22 15:35:36 +00:00
Elliott Hughes
85164759f7 Merge "Stop trying to be clever with sysconf(_SC_NGROUPS_MAX)." into main 2024-02-22 15:35:23 +00:00
Elliott Hughes
ea8be9ff96 Merge "Clarify _PC_REC_INCR_XFER_SIZE and _PC_REC_MAX_XFER_SIZE." into main 2024-02-22 15:34:28 +00:00
Jooyung Han
caeb54a332 Merge "use /system/bin/sh for all" into main am: 79434542bc
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2969412

Change-Id: I229fe068b9a9d2a3c571d1f33c77536af0f6e8ba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-22 06:40:57 +00:00
Jooyung Han
79434542bc Merge "use /system/bin/sh for all" into main 2024-02-22 05:59:22 +00:00
Elliott Hughes
dd756ae82d Stop trying to be clever with sysconf(_SC_NGROUPS_MAX).
The test failed the first time someone ran it as a non-root user.
Definitely not worth changing sepolicy for this, and even if we did,
that wouldn't work for static binaries (to the extent that we care).

Bug: http://b/326189243
Test: treehugger
Change-Id: I02441ce7f69ac477b0223565ac490046cee12579
2024-02-21 20:44:07 +00:00
Elliott Hughes
ae0d0c9e76 Clarify _PC_REC_INCR_XFER_SIZE and _PC_REC_MAX_XFER_SIZE.
The -1 from pathconf()/fpathconf() with these isn't the "I don't know
what you're talking about" -1/EINVAL, but the "I understand the
question, but don't have an answer for you --- you'll have to try it and
see" -1.

Bug: http://b/326245682
Test: treehugger
Change-Id: I67be277f3ffd9b5a355787ae7ffc4a31e32b0128
2024-02-21 19:18:09 +00:00
Treehugger Robot
2f8ccc57a1 Merge changes from topics "crashapi2", "crashapi3" into main am: 30c7aad06d
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2961904

Change-Id: I36d33a95fbd92f2fee23c4f50061e1b7e0aadabc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-21 08:30:41 +00:00
Florian Mayer
4bd5112e33 Allow to re-use the same crash_detail. am: e2aefc46e7
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2962622

Change-Id: I5f886e0a3f609f06f0679a6d71103a83841a64e9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-21 08:30:35 +00:00
Treehugger Robot
30c7aad06d Merge changes from topics "crashapi2", "crashapi3" into main
* changes:
  header and android_crash_detail prefix for crash_detail API
  Allow to re-use the same crash_detail.
2024-02-21 07:42:42 +00:00
Jooyung Han
35bdfa040f use /system/bin/sh for all
Since Treble, /vendor components has been using /vendor/bin/sh. But this
gets complicated with APEXes, /odm, apps, etc. We now switch back to
/system/bin/sh for all domains. In practice, this should be okay because
/system/bin/sh is almost stable.

Bug: 324142245
Test: system("readlink /proc/$$/exe") in vendor components
Change-Id: Id830aa8281e7cbda1f15474174c38d8e28dc358b
2024-02-21 16:02:22 +09:00
Florian Mayer
ca4749af30 header and android_crash_detail prefix for crash_detail API
Bug: 155462331
Change-Id: Ib1c0ac76d2bd036a6b802b0997d9de8be61dfd2b
2024-02-20 23:41:38 +00:00
Florian Mayer
ce81e05947 Merge "Reland^2 "[MTE] remap stacks with PROT_MTE when requested by dlopened library"" into main am: ca6861e8ad
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2966402

Change-Id: If7b9af86bdb351223ccef47376aa8326e9dca7e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-17 00:24:50 +00:00
Jernej Virag
2b11b65adc Merge "Revert "use /system/bin/sh for new vendor partition"" into main am: 44890f9e52
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2967125

Change-Id: I9c32037ef8076875c4c72dbd6cf47fab41e9ffa2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-16 10:49:56 +00:00
Jernej Virag
44890f9e52 Merge "Revert "use /system/bin/sh for new vendor partition"" into main 2024-02-16 10:13:22 +00:00
Joonhun Shin
780e8eac5a Revert "use /system/bin/sh for new vendor partition"
Revert submission 2964802-sh_path

Reason for revert: <b/325569171>

Reverted changes: /q/submissionid:2964802-sh_path

Change-Id: Ie050cf1f402bbf599a00633a8c2a911334ae848b
2024-02-16 09:22:47 +00:00
Jooyung Han
a97819cf51 Merge "use /system/bin/sh for new vendor partition" into main am: 1a1d7a189e
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2963307

Change-Id: I4baedf7bf55cf727b4e192885e64d2f8d3e24ad1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-16 07:58:34 +00:00
Jooyung Han
1a1d7a189e Merge "use /system/bin/sh for new vendor partition" into main 2024-02-16 06:56:45 +00:00
Florian Mayer
e65e1939a1 Reland^2 "[MTE] remap stacks with PROT_MTE when requested by dlopened library"
Also enable stack MTE if main binary links in a library that needs it.

Otherwise the following is possible:

1. a binary doesn't require stack MTE, but links in libraries that use
   stg on the stack
2. that binary later dlopens a library that requires stack MTE, and our
   logic in dlopen remaps the stacks with MTE
3. the libraries from step 1 now have tagged pointers with missing tags
   in memory, so things go wrong

This reverts commit f53e91cc81.

Reason for revert: Fixed problem detected in b/324568991

Test: atest memtag_stack_dlopen_test with MTE enabled
Test: check crash is gone on fullmte build
Change-Id: I4a93f6814a19683c3ea5fe1e6d455df5459d31e1
2024-02-15 17:47:19 -08:00
Elliott Hughes
3ed6e722e3 Clean up the <netinet/ether.h> implementation.
Test: treehugger
Change-Id: Ifd8bf344583b74737a05b80e30373ab7bef94f8d
2024-02-16 01:23:46 +00:00
Jooyung Han
c03b656a94 use /system/bin/sh for new vendor partition
For devices with ro.board.api_level >= 202404, use /system/bin/sh for
all domains include /vendor and other partitions.

Bug: 324142245
Test: system("readlink /proc/$$/exe") in vendor components
Change-Id: Ifa4f38e542377ce1482516fba4f0001c09c5a869
2024-02-16 00:25:33 +00:00
Elliott Hughes
886193648e Merge "Simplify our trivial initgroups(), and add a test." into main am: 76cab44ab1
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2961910

Change-Id: I9482bd663857e9a522d871123cfdc5fecc44e911
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-15 23:34:11 +00:00
Elliott Hughes
6a45884851 Simplify our trivial initgroups(), and add a test.
initgroups() is just a call to getgrouplist() followed by a call to
setgroups(). The tricky part is memory allocation. OpenBSD allocates an
NGROUPS_MAX-sized array of gid_t on the stack. FreeBSD allocates a
sysconf(_SC_NGROUPS_MAX)-sized array of gid_t on the heap. bionic had a
mix where it would try a 2-element stack array but fall back to a heap
allocation, which sounds reasonable if you want to avoid a 256KiB
(64Ki*4 bytes) allocation on either stack or heap. But that constant 2?
That's weird in two ways... It's really small (musl has an NGROUPS_MAX
of 32 unlike the Linux kernel's 64Ki, but 32 is still a lot larger than
2), but at the same time it's too big --- bionic's getgrouplist() always
returns a single element.

So although the FreeBSD "what the hell, let's just allocate 256KiB on
the heap" implementation would have been fine, there's really no point,
and anyone who's trying to understand initgroups() on Android really
needs to read getgroupslist() anyway, so let's just have the most
trivial implementation -- a single-element array -- and let's have it
right next to getgroupslist() in the same file as all the other <grp.h>
functions.

Also add a trivial smoke test. You mostly won't have permission to do
anything interesting with initgroups(), and it's basically unused save
for privilege dropping tcpdump and strace, but we may as well make an
effort. (I tested tcpdump before and after too.)

Test: treehugger
Change-Id: I67fe02e309ed1dbefc490c01733738363ca606be
2024-02-14 17:19:14 -08:00
Treehugger Robot
37bea4ec73 Merge "Revert^3 "[MTE] remap stacks with PROT_MTE when requested by dlopened library"" into main am: 469568b94a
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2957057

Change-Id: Iaa45c5c3038467fbbeaab93d51e96dd11707c6bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-15 00:22:54 +00:00
Treehugger Robot
469568b94a Merge "Revert^3 "[MTE] remap stacks with PROT_MTE when requested by dlopened library"" into main 2024-02-14 23:48:49 +00:00
Elliott Hughes
976f598cf3 Merge "Fix sysconf(_SC_NGROUPS_MAX)." into main am: b28adb35bd
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2962906

Change-Id: Id7759b3ebaee591c886c680bd4b14db08654bbb1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-14 21:38:18 +00:00
Elliott Hughes
6995b4ae5c Merge "Move three legacy .c files to .cpp." into main am: 5a1f29e6cf
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2962068

Change-Id: Iba01335f37b4f7abbbdd248143fe9b5c315b35f7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-14 21:37:55 +00:00
Elliott Hughes
b28adb35bd Merge "Fix sysconf(_SC_NGROUPS_MAX)." into main 2024-02-14 21:17:29 +00:00
Elliott Hughes
5a1f29e6cf Merge "Move three legacy .c files to .cpp." into main 2024-02-14 20:55:50 +00:00
Florian Mayer
f53e91cc81 Revert^3 "[MTE] remap stacks with PROT_MTE when requested by dlopened library"
This reverts commit a453c2df74.

Reason for revert: b/324568991

Bug: 324568991
Change-Id: Ia6250ebe51c505bd4b77af2b4ff4e95c8b370acd
2024-02-14 18:50:42 +00:00
Florian Mayer
ff5de237b4 Merge "Add API to allow apps to attach extra information to tombstones." into main am: 50f4d83960
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2955867

Change-Id: I7c8fa3892054dc4c069583c5bce8bbc674c61ab5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-14 17:40:42 +00:00
Florian Mayer
50f4d83960 Merge "Add API to allow apps to attach extra information to tombstones." into main 2024-02-14 17:06:07 +00:00
Elliott Hughes
b3877437cd Fix sysconf(_SC_NGROUPS_MAX).
The previous implementation wasn't wrong (it returned the "maximum
maximum"), but we can return the actual runtime value from the kernel.

Noticed while looking at initgroups().

Test: treehugger
Change-Id: I891fe4ff29bd82ee05d9e05ed8299d32c21abd7f
2024-02-13 16:48:30 -08:00
Elliott Hughes
17e4068bda Move three legacy .c files to .cpp.
Test: treehugger
Change-Id: Ic22896d25881fe35f28bad53c5412e3e1d4b2661
2024-02-13 16:36:11 -08:00
Florian Mayer
e2aefc46e7 Allow to re-use the same crash_detail.
This is for advanced use-cases that have high performance demands and
know they will repeatedly re-use the crash_detail.

Bug: 155462331
Change-Id: Ib15dac70d1d598f78b74b539aeadf88b0ca32bc7
2024-02-13 13:44:32 -08:00
Florian Mayer
7c83d09679 Add API to allow apps to attach extra information to tombstones.
Test: atest debuggerd_test
Bug: 155462331
Bug: 309446525
Change-Id: Idc8387307738957dbba3daaae59f605566329f0f
2024-02-13 13:41:12 -08:00
Nick Desaulniers
2add976832 Merge "libc/Android.bp: make libc_headers visible to llvm-libc" into main am: d74f255a50
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2957803

Change-Id: Ic4dcd7b9d032cc775057b5e3cc5306d50452be26
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-12 22:03:07 +00:00
Elliott Hughes
048c52b92b Merge "libc/Android.bp: more cleanup." into main am: 16da14df14
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2956138

Change-Id: I287684dfd59d42abcc479886ceac6ace76257060
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-12 21:19:56 +00:00
Nick Desaulniers
d74f255a50 Merge "libc/Android.bp: make libc_headers visible to llvm-libc" into main 2024-02-12 21:13:33 +00:00
Nick Desaulniers
942ae55dc4 libc/Android.bp: make libc_headers visible to llvm-libc
llvm-libc will reuse parts of the existing system headers for types that have
implications on the ABI.

Fixes:
    error: external/llvm-libc/Android.bp:3:1: module "llvmlibc" variant
    "android_recovery_riscv64_static": depends on //bionic/libc:libc_headers
    which is not visible to this module You may need to add
    "//external/llvm-libc" to its visibility

Test: TH
Bug: 321313756
Change-Id: I33b93d8e1617a480249641dc2cdf4bbee9f9e19d
2024-02-12 10:28:40 -08:00
Elliott Hughes
69bd8e9da2 libc/Android.bp: more cleanup.
These files were segregated because they were lacking a little cleanup.
Unfortunately that means this change has to do some of the cleanup, but
that's probably for the best.

Test: treehugger
Change-Id: I2dd33504787fc3313995de99e0745a0df22915b3
2024-02-09 10:04:26 -08:00
Elliott Hughes
8ca76a29b7 Merge "libc/Android.bp: merge libc_openbsd_ndk." into main am: e3f09effb3
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2954357

Change-Id: Icb53f37f8ba36fcc93d820b4ae8b5aedaf87bbce
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-09 16:49:54 +00:00
Elliott Hughes
e3f09effb3 Merge "libc/Android.bp: merge libc_openbsd_ndk." into main 2024-02-09 16:09:54 +00:00
Florian Mayer
5b44bc316a Merge "Reland "[MTE] remap stacks with PROT_MTE when requested by dlopened library"" into main am: a732e2aef5
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2955914

Change-Id: I91f22862517b6c3b41893ac913a282a600a9f398
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-09 05:15:16 +00:00
Florian Mayer
a732e2aef5 Merge "Reland "[MTE] remap stacks with PROT_MTE when requested by dlopened library"" into main 2024-02-09 04:35:03 +00:00
Florian Mayer
a453c2df74 Reland "[MTE] remap stacks with PROT_MTE when requested by dlopened library"
This reverts commit c20e1c2bdf.

Reason for revert: Was not the root-cause of test failure.

Change-Id: I7dcd9fc3cbac47703fa8ecd5aafd7e1c3ed87301
2024-02-09 00:40:45 +00:00
Elliott Hughes
968adf951c libc/Android.bp: merge libc_openbsd_ndk.
Test: treehugger
Change-Id: I313f8ecc28f1d0129e2b6d65ace3b6a1e05c906a
2024-02-08 13:15:53 -08:00
Florian Mayer
e8ea440525 Merge "Revert "[MTE] remap stacks with PROT_MTE when requested by dlopened library"" into main am: cebe1f1351
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2954775

Change-Id: I6a49c246c2415e6ae6c676d129f7d917b47bdf92
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-08 19:30:28 +00:00
Florian Mayer
cebe1f1351 Merge "Revert "[MTE] remap stacks with PROT_MTE when requested by dlopened library"" into main 2024-02-08 18:47:42 +00:00
Elliott Hughes
cd0b553f42 Merge "More libc/Android.bp simplification." into main am: 8259120694
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2955183

Change-Id: Ie4b1c4d6bf7c3803a7066323464749b9b33bc58d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-08 18:11:12 +00:00
Sojin Moon
c20e1c2bdf Revert "[MTE] remap stacks with PROT_MTE when requested by dlopened library"
This reverts commit 79c9694c91.

Reason for revert: DroidMonitor: Potential culprit for Bug b/324348078 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I32f7bc824900e18a7d53b025ffe3aaef0ee71802
2024-02-08 07:21:15 +00:00
Elliott Hughes
2e2b9bcf3d More libc/Android.bp simplification.
Merge libc_bionic_ndk into libc_bionic.

Test: treehugger
Change-Id: I07dbb7e20e12000a2c18ff6fab2d5bd81db0cfcd
2024-02-07 16:10:23 -08:00
Kalesh Singh
653bf2a743 Merge changes Ie770320e,I32c05cce,Ia7cb2f40 into main am: 41ed53fac6
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2948920

Change-Id: Id2b075604fa8832f1f4b9729599a28a2276cac87
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-07 20:19:59 +00:00
Kalesh Singh
41ed53fac6 Merge changes Ie770320e,I32c05cce,Ia7cb2f40 into main
* changes:
  bionic: linker_phdr: Introduce kPageSize
  bionic: Introduce ElfReader::ReadPadSegmentNote()
  bionic: Refactor __get_elf_note()
2024-02-07 19:28:40 +00:00
Elliott Hughes
63eb28c589 Merge "Remove treble_linker_namespaces." into main am: aa19eae4c2
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2951946

Change-Id: Icbbd2e8ccac65eb8e69e972258c385edb780b802
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-07 16:47:55 +00:00
Elliott Hughes
aa19eae4c2 Merge "Remove treble_linker_namespaces." into main 2024-02-07 16:05:57 +00:00
Kalesh Singh
f0050fb015 bionic: Refactor __get_elf_note()
Factor out generic __get_elf_note() logic and rename __get_elf_note() to
__find_elf_note(). Expose __get_elf_note() in libc/private/bionic_note.h

This will be used in the subsequent patch to test the presence of
NT_ANDROID_TYPE_PAD_SEGMENT note when loading segments.

Test: atest -c linker-unit-tests [Later patch]
Test: m && launch_cvd
Bug: 316403210
Change-Id: Ia7cb2f40b10cfaef402182a675087c8422b37e4d
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-02-06 17:58:40 -08:00
Florian Mayer
f252b3fda6 Merge "[MTE] remap stacks with PROT_MTE when requested by dlopened library" into main am: ba5630cede
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2901508

Change-Id: I23578f32fb295e96f6f074f00952e72dd3d9640e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-06 17:00:26 +00:00