Commit graph

37122 commits

Author SHA1 Message Date
Florian Mayer
cc61ad895e Add android_mallopt to query MTE stack state
Bug: 244364391
Change-Id: Ie6267201f0c2e293b27c71cd160a2311c9de8091
2022-09-07 23:38:42 +00:00
Florian Mayer
44742701c9 Merge "Revert^2 "memtag_stack tests."" 2022-09-01 19:29:33 +00:00
Treehugger Robot
de01d6f0c2 Merge "Fix comment to indicate android_mallopt is also available to APEXes." 2022-09-01 02:25:19 +00:00
Florian Mayer
d71bc4bc3a Fix comment to indicate android_mallopt is also available to APEXes.
Change-Id: Ic8ed578ab3323e6e1a80e05756202354b92fd512
2022-08-31 22:30:04 +00:00
Florian Mayer
c82d7fcd22 Revert^2 "memtag_stack tests."
8162b05ccd

Change-Id: I68c1988b0d76dddfaf69189cfd439192cabda00d
2022-08-31 20:57:03 +00:00
Florian Mayer
376e9b07ca Merge "Revert "memtag_stack tests."" 2022-08-31 18:37:29 +00:00
Florian Mayer
8162b05ccd Revert "memtag_stack tests."
Revert "[soong] Add memtag-stack sanitizer, switch to linker-gen..."

Revert submission 2096883-memtag-stack

Reason for revert: b/244454542
Reverted Changes:
I7fee03d90:memtag_stack tests.
I52d2318c8:[soong] Add memtag-stack sanitizer, switch to link...

Change-Id: I0dac2a6a6757a78c9f831cd7cc463b0e0f6376c6
2022-08-31 18:30:18 +00:00
Florian Mayer
5c6c043820 Merge "memtag_stack tests." 2022-08-31 17:53:43 +00:00
Evgenii Stepanov
d624d2f3d9 memtag_stack tests.
This tests cover stack tagging setup in response to NT_MEMTAG_STACK and
vfork and longjmp support.

Bug: b/174878242
Test: fvp_mini with ToT LLVM
  SANITIZE_TARGET="memtag_heap"
  SANITIZE_TARGET="memtag_heap,memtag_stack"

Change-Id: I7fee03d901092d9428d86a6fab6bef4e2e3b51eb
2022-08-30 18:00:21 +00:00
Treehugger Robot
efe45a1d43 Merge "Add fdsan owner type for native_handle_t" 2022-08-29 21:54:10 +00:00
Brian Duddie
5cfca6b832 Add fdsan owner type for native_handle_t
Bug: 244214188
Test: validated alongside sensor service change
Change-Id: Ia576b551012c50def8a8ebe82115ceac35070dcb
2022-08-29 21:29:45 +00:00
Elliott Hughes
cfc991608c Merge "setjmp.h: add the missing __returns_twice to sigsetjmp()." 2022-08-25 23:30:29 +00:00
Elliott Hughes
963e24b93e setjmp.h: add the missing __returns_twice to sigsetjmp().
setjmp() and _setjmp() were already correct, but we'd missed
sigsetjmp(). Found while investigating a toybox timeout(1) failure on
macOS, which doesn't annotate _any_ of these functions.

Also add all the missing doc comments while I'm here.

Test: treehugger
Change-Id: I69dc2587d140916d172237173c2bd56547a4ed8a
2022-08-25 20:13:00 +00:00
Jiyong Park
c00d06867a Merge "Use liblog_for_runtime_apex instead of liblog" 2022-08-19 16:03:05 +00:00
Jiyong Park
7157dfbfe7 Use liblog_for_runtime_apex instead of liblog
liblog_for_runtime_apex is a static variant of liblog which is
explicitly marked as available to the runtime APEX. Any static
dependency to liblog from inside the runtime APEX is changed from liblog
to liblog_for_runtime_apex.

Previously, to support the need for using liblog inside the runtime
APEX, the entire (i.e. both static and shared variants) liblog module
was marked as available to the runtime APEX, although in reality only
the static variant of the library was needed there. This was not only
looking dirty, but also has caused a problem like b/241259844.

To fix this, liblog is separated into two parts. (1) liblog and (2)
liblog_for_runtime_apex. (1) no longer is available to the runtime APEX
and is intended to be depended on in most cases: either from the
non-updatable platform, or from other APEXes. (2) is a static library
which is explicitly marked as available to the runtime APEX and also
visible to certain modules that are included in the runtime APEX.

Bug: 241259844
Test: m and check that liblog depends on stub library of libc
Change-Id: Ib21f6e64da0c7592341b97b95ca8485d7c29ac4d
2022-08-19 13:09:18 +09:00
Florian Mayer
af24941d48 Merge "[MTE] Never upgrade MTE mode for zygote." 2022-08-16 16:23:50 +00:00
Florian Mayer
14cbb7963a [MTE] Never upgrade MTE mode for zygote.
Bug: 169277947
Change-Id: I90e9f3d2084b0ef5d035b5ae3e5101e365038f26
2022-08-15 14:34:49 -07:00
Christopher Ferris
df75e05551 Merge "Adjust the calculation method of pc" am: 94d8e02d33
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2145980

Change-Id: Ie15179c4d8d71783e03c13dd31ec5d55d6d494d2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-13 01:17:20 +00:00
Christopher Ferris
94d8e02d33 Merge "Adjust the calculation method of pc" 2022-08-13 00:53:05 +00:00
周至捷
4b84644ac1 Adjust the calculation method of pc
offset is required anytime
fix issue:
https://issuetracker.google.com/issues/238368984

Bug: 238569739

Signed-off-by: 周至捷 <zhouzhijie@xiaomi.com>
Change-Id: I0eeb2940235047b8e7980f5c8bce69c6904d4e9d
2022-08-12 22:34:21 +00:00
Treehugger Robot
2e48f897b5 Merge "Exclude BUILD files from musl sysroot globs" am: d3c7700aa0
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2184577

Change-Id: Ia7753a900f0477a8a306af3b069d4176caaa78f6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-12 21:37:53 +00:00
Treehugger Robot
d3c7700aa0 Merge "Exclude BUILD files from musl sysroot globs" 2022-08-12 21:14:52 +00:00
Christopher Ferris
915d728a94 Merge "Add the .debug_frame for arm32." am: 52b20bd71c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2184318

Change-Id: I8b6749e1a37efeb1325c6b48d215402decc5a6e1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-12 21:02:32 +00:00
Christopher Ferris
52b20bd71c Merge "Add the .debug_frame for arm32." 2022-08-12 20:31:36 +00:00
Colin Cross
1c0a7a09ff Exclude BUILD files from musl sysroot globs
Don't package the BUILD files into musl sysroots.

Test: build musl sysroot
Change-Id: I260a59a8c0cdd5b4249b657c8435c01fbb56eeb7
2022-08-12 11:49:24 -07:00
Christopher Ferris
d37df2b638 Add the .debug_frame for arm32.
As with libc.so, add the debug frame into the linker for arm32
to make any crashes unwindable.

Bug: 242162222

Test: Forced a crash on wembley where an unwind failed before and
Test: verified it unwinds properly with the debug frame.
Change-Id: I2b904af63f670b038d169f5a7d907637b352ab4e
2022-08-11 17:39:43 -07:00
Elliott Hughes
b8d5a130a6 Merge "Add C23's memset_explicit()." am: f9fac36f15
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2182298

Change-Id: Ib3e755aff50d721d1a86034687415c9ef8196677
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 22:09:56 +00:00
Christopher Ferris
6eb1f11001 Merge "Update to v5.19 kernel headers." am: bf75d08b13
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2181976

Change-Id: Iae548634e7f5c00fe821294081ac12a4243dce03
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 22:09:39 +00:00
Elliott Hughes
f9fac36f15 Merge "Add C23's memset_explicit()." 2022-08-11 22:01:28 +00:00
Christopher Ferris
bf75d08b13 Merge "Update to v5.19 kernel headers." 2022-08-11 21:50:34 +00:00
Elliott Hughes
32188c716e Merge "Add %b and %B support to the scanf/wscanf and strto*/wcsto* families." am: d1c3d4a454
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2175189

Change-Id: I8fef15363132b4dbd2fcc44fab9226c919ee4b58
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 21:43:00 +00:00
Elliott Hughes
d1c3d4a454 Merge "Add %b and %B support to the scanf/wscanf and strto*/wcsto* families." 2022-08-11 21:22:23 +00:00
Elliott Hughes
1f462dec34 Add %b and %B support to the scanf/wscanf and strto*/wcsto* families.
Coming to C23 via WG14 N2630.

This one is a little interesting, because it actually changes existing
behavior. Previously "0b101" would be parsed as "0", "b", "101" by these
functions. I'm led to believe that glibc plans to actually have separate
versions of these functions for C23 and pre-C23, so callers can have the
behavior they (implicitly) specify by virtue of which -std= they compile
with. Android has never really done anything like that, and I'm pretty
sure app developers have more than enough to worry about with API levels
without having to deal with the cartesian product of API level and C
standard.

Therefore, my plan A is "if you're running on Android >= U, you get C23
behavior". My plan B in the (I think unlikely) event that that actually
causes trouble for anyone is "if you're _targeting_ Android >= U, you
get C23 behavior". I don't think we'd actually want to have two versions
of each of these functions under any circumstances --- that seems by far
the most confusing option.

Test: treehugger
Change-Id: I0bbb30315d3fabd306905ad1484361f5d8745935
2022-08-11 00:25:08 +00:00
Elliott Hughes
0d64243407 Add C23's memset_explicit().
https://open-std.org/jtc1/sc22/wg14/www/docs/n2897.htm

Test: treehugger
Change-Id: Ia0cfc72bdf3c22eda6a4fc9adaa4c0ca0ff9a7c8
2022-08-10 23:36:16 +00:00
Florian Mayer
20678e18f7 Merge "Allow init to upgrade MTE to sync." am: ea7f84435d
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2107287

Change-Id: Id4d505bde293992ca761da1b7cfd97b8dc1913ce
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 20:18:05 +00:00
Christopher Ferris
97417cb356 Merge "Add support for removing structs that cross blocks." am: 0ba4b34206
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2175190

Change-Id: I94abfec1aa97a9dce5d3537ebd8f1a49725ec4c8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 20:17:48 +00:00
Christopher Ferris
80ae69d11e Update to v5.19 kernel headers.
Kernel headers coming from:

Git: https://android.googlesource.com/kernel/common/
Branch: android-mainline
Tag: android-mainline-5.19

Test: Builds on coral.
Test: All bionic unit tests pass on a coral device.
Test: Able to log in to wembley system.
Change-Id: I6fa6f6edb59f2cef990a7ba96877d9f2d3974c62
2022-08-10 12:58:45 -07:00
Florian Mayer
ea7f84435d Merge "Allow init to upgrade MTE to sync." 2022-08-10 19:57:07 +00:00
Christopher Ferris
0ba4b34206 Merge "Add support for removing structs that cross blocks." 2022-08-10 19:55:35 +00:00
Florian Mayer
408e1700f8 Allow init to upgrade MTE to sync.
Bug: 169277947
Test: see other change in topic
Change-Id: I9f5820ffaeb23a4f5539bdbe3db1b455e45d84d8
2022-08-10 10:11:08 -07:00
Christopher Ferris
3fc4e11607 Add support for removing structs that cross blocks.
The latest kernel has a struct that needs to be removed,
but the struct crosses blocks. Add support for removing a
struct that does cross blocks. This support is very primitive,
and will not parse any really complicated struct that uses
defines in complicated ways.

Combine the kernel_structs_to_remove and kernel_struct_replacements
structure into a single map. This allows marking a structure
to be removed as replaced with an #include <bits/STRUCT.h>.

The new support for the remove of structures is all in the
removeStructs function.

Raise an exception if the struct parsing does not work properly.

Add new unit tests for all of the new code.

In addition, fix the algorithm for deleting the uapi directory
before it gets updated. A new file BUILD was checking in that
directory, so delete everything in the directory except that
BUILD file.

Test: Unit tests pass.
Test: Running update_all.py results in the no unexpected changes.
Change-Id: I9a8cef0321beaf71d03b5b874327747a7edb6119
2022-08-09 17:49:31 -07:00
Christopher Ferris
31778b8606 Merge "Fix old python2 test issue." am: 85e2fc6104
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2175187

Change-Id: I716463773101684f9bab7fcd0b2577793f4f05ab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-06 02:18:00 +00:00
Christopher Ferris
85e2fc6104 Merge "Fix old python2 test issue." 2022-08-06 01:00:25 +00:00
Christopher Ferris
e0cb4e1094 Fix old python2 test issue.
The map function returns a list in python2, but not in python3.
Force the test in cpp.py get_blocks() function to return a list.

Test: All cpp.py unit tests pass.
Change-Id: I1a63b92ac6cdb785830846fbd7e726eca7520e96
2022-08-05 12:59:05 -07:00
Elliott Hughes
70efcef338 Merge "Don't even try to allocate 2GiB on LP32." am: 462c542855
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2172902

Change-Id: I3e4e8e91e78f42e7f263c1a90417b9c1afe62943
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-03 16:01:17 +00:00
Elliott Hughes
462c542855 Merge "Don't even try to allocate 2GiB on LP32." 2022-08-03 15:35:49 +00:00
Treehugger Robot
2d9b7fe265 Merge "[MTE] Add comment about nested ScopedDisableMTE in test." am: c3288a19e9
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2172809

Change-Id: I5e776528c017b37e2e99957854dd4598f85ea1a7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-03 03:06:23 +00:00
Treehugger Robot
c3288a19e9 Merge "[MTE] Add comment about nested ScopedDisableMTE in test." 2022-08-03 02:50:38 +00:00
Florian Mayer
5d35ab8f42 [MTE] Add comment about nested ScopedDisableMTE in test.
Change-Id: I02a4b44ebe1fad6f00b10d1083b43b52a0b5c316
2022-08-02 23:52:43 +00:00
Elliott Hughes
15008d6a76 Merge "Add %b and %B support to the printf/wprintf family." am: cede011a2c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2169037

Change-Id: Ifc47fe448921e91788c6afac3488f19596f1803a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 18:30:21 +00:00