Commit graph

11067 commits

Author SHA1 Message Date
Elliott Hughes
61d435c29a Merge "riscv64: typedef struct ucontext {...} ucontext_t." 2023-04-03 15:23:31 +00:00
Treehugger Robot
e744d81787 Merge "Nullability check for dirent module" 2023-04-01 02:46:24 +00:00
Zijun Zhao
6ef483eb87 Merge "posix_spawn_file_actions_addopen(): crash early rather than late." 2023-03-31 23:59:02 +00:00
Elliott Hughes
53c90ebfdd riscv64: typedef struct ucontext {...} ucontext_t.
All the other architectures are already polluting the namespace with
`struct ucontext`, so make riscv64 match for source compatibility with
other Android code. (Code _should_ be using the POSIX `ucontext_t`, but
ART in particular had a lot of `struct ucontext`, and although I'll
clean that up separately, if there's some in our tree, there's probably
a lot more out there in the wild.)

Test: treehugger
Change-Id: Id0e4e97e660d7d60e792cd2462ddb9788d4772d7
2023-03-31 15:31:37 -07:00
Elliott Hughes
b8e4e469dc posix_spawn_file_actions_addopen(): crash early rather than late.
We're going to dereference a null pointer if you pass one instead of a
pointer to a path, but at the moment (because of implementation sharing
between the different file actions) we won't do it until the last
minute, in the child itself. Let's crash as soon as you make the mistake
instead, to make debugging a lot easier.

Test: treehugger
Change-Id: I987d2700ba05b9867a936ebe770224259376633f
2023-03-31 20:18:18 +00:00
zijunzhao
7d2df8be98 Nullability check for dirent module
Bugs: b/245972273
Test: adb shell
Change-Id: I70532170144a65f00dbccf56378f55daf2d362df
2023-03-31 18:54:31 +00:00
Treehugger Robot
5ae243b7f9 Merge "Nullability check for fts module" 2023-03-30 18:20:48 +00:00
zijunzhao
dec8efd72a Nullability check for fts module
Bugs: b/245972273
Test: adb shell
Change-Id: I56f796a3968484c69c3389fffafdbd960a99845f
2023-03-29 22:51:24 +00:00
zijunzhao
2146303272 Nullability check for sched module.
Bugs: b/245972273
Test: adb shell
Change-Id: Icb8028ec5864370c0ebfb300f9b6df01edf2742d
2023-03-29 21:46:57 +00:00
Elliott Hughes
9dfcaa64e8 Merge "scandir: clarity improvements." 2023-03-29 21:07:25 +00:00
zijunzhao
99dd5b1e27 Nullability correction for stdlib module.
Bugs: b/245972273
Test: adb shell
Change-Id: I0a800ccfe3bae88d3e924dd621bad182cb186b27
2023-03-29 00:26:29 +00:00
Elliott Hughes
f6c25d6fd3 scandir: clarity improvements.
Move the "is there a comparator?" check into the sole caller, to match
the "is there a filter?" check. Remove the unnecessary (and unlikely)
pre-sort "is the array empty?" check.

Test: treehugger
Change-Id: I8bd461380420dce4a8bc05ef5fe3511b26347d7c
2023-03-28 22:35:24 +00:00
Christopher Ferris
345f54666a Merge "Move M_PURGE to M_PURGE_ALL." 2023-03-24 19:29:51 +00:00
Treehugger Robot
76210fba9e Merge "Time for SEO in <android/api-level.h>." 2023-03-24 16:10:48 +00:00
Yi Kong
ab3a319746 Merge "Workaround boot loop by turning off stack protector check for noreturn calls" 2023-03-24 13:19:52 +00:00
Elliott Hughes
572053a02e Time for SEO in <android/api-level.h>.
So many names/numbers for one release...

Test: treehugger
Change-Id: I00ddb13485c185fc003ea087f1df404bc39fa435
2023-03-23 21:30:15 +00:00
Dan Albert
b3e895c86a Add macro for API level V.
No idea if this will be the actual API level or not, but that's all
the more reason to abstract it away early...

Bug: None
Test: None
Change-Id: I8a17bb42dbb08a6e760427514af8331e7dc9b549
2023-03-23 18:35:16 +00:00
Christopher Ferris
f1ab9c4de7 Move M_PURGE to M_PURGE_ALL.
Since it doesn't matter if these calls take a little longer than
before, use the more thorough but slightly longer purge mechanism.

Test: Unit tests pass.
Change-Id: Ifab7166a9682a13231746b78717d52673d13be1b
2023-03-22 13:47:27 -07:00
Elliott Hughes
060cd2438c Merge "riscv64 SCS support." 2023-03-21 22:10:56 +00:00
Christopher Ferris
424cf4378a Merge "Fix mte build breakage." 2023-03-21 21:20:55 +00:00
Florian Mayer
b4f4f4ecea Merge "Add debug logging for memtag level" 2023-03-21 20:37:00 +00:00
Christopher Ferris
35759fa84c Fix mte build breakage.
The strerror_buf is way too large, so instead of using a separate
buffer for just this string, reuse the already existing buffer.
Increase the buffer size to cover the maximum errno string.

Add a unit test to verify that none of the errno values are cut off
in the async_safe_format_buffer function when passing %m.

Bug: 274474681

Test: New unit test passes.
Test: Changing the buffer to a small value and verify that the test fails.
Change-Id: I4cb4652709582a8a6b958e12de5d923ec950e6b6
2023-03-21 18:11:02 +00:00
Florian Mayer
b3f3e86878 Add debug logging for memtag level
Test: adb logcat 'libc:D' | grep memtag
Bug: 272596642
Change-Id: I764a0ea4fd71b547d1c5b82a1537e50016578e0f
2023-03-21 11:10:43 -07:00
caowencheng
9a39eb3469 Increase the implementation of __memcpy_chk assembly
Use __memcpy_chk assembly to replace the implementation of c functions, which can reduce the use of instructions

Test: llvm-objdump

Change-Id: I5d75601626dc997626f6173d53af301183a64004
Signed-off-by: caowencheng <caowencheng@eswincomputing.com>
2023-03-21 02:05:14 +00:00
Mitch Phillips
008dc0d50b Merge "No-op DT_AARCH64_MEMTAG_* entries" 2023-03-20 22:06:40 +00:00
Elliott Hughes
7559e5b051 Merge "Use <bits/timespec.h> from uapi headers too." 2023-03-20 19:46:57 +00:00
Elliott Hughes
875d40559e Use <bits/timespec.h> from uapi headers too.
Bug: https://github.com/android/ndk/issues/1852
Test: treehugger
Change-Id: I554b31d2c4c443d37506e97a36099efbd3ad0e11
2023-03-20 15:07:16 +00:00
Zijun Zhao
8ed5cace7d Merge "Nullability check for link module" 2023-03-17 23:51:54 +00:00
Mitch Phillips
2e25c0f943 No-op DT_AARCH64_MEMTAG_* entries
As of https://reviews.llvm.org/D143769, binaries (with -fsanitize=memtag-*)
have DT_AARCH64_MEMTAG_* dynamic entries, as per the AArch64 MemtagABI.
Android uses an OS-specific ELF note for MTE config, but we should
migrate to the new thing (while preserving backwards compatibility).

Without actually doing the migration right now, just handle these new
entries. Otherwise, you get a whole bunch of logspam about the
unrecognised dynamic entries.

Bug: 274032544
Test: Build android, don't get logspam.
Change-Id: I5c8b59f77a0058e5b93335e269d558a5014f2260
2023-03-17 16:09:39 -07:00
Christopher Ferris
dcd1403818 Merge "Add support for M_PURGE_ALL." 2023-03-17 21:06:20 +00:00
Zijun Zhao
df92729c64 Merge "Nullability check for pwd module" 2023-03-17 20:43:32 +00:00
zijunzhao
5250d79abc Nullability check for pwd module
Bugs: b/245972273
Test: adb shell
Change-Id: I855a4e6401220e2b84f303420e8fca63bcf47e03
2023-03-17 02:53:37 +00:00
zijunzhao
0a515826af Nullability check for link module
Bugs: b/245972273
Test: adb shell
Change-Id: I850deb5422604731d1d1b4ab3ea86aedad52a883
2023-03-17 02:52:15 +00:00
zijunzhao
106aa0074d Nullability check for locale module
Bugs: b/245972273
Test: adb shell
Change-Id: If730065895e0f074318df545906b7e60fcae053d
2023-03-16 21:42:57 +00:00
Treehugger Robot
8270ec9282 Merge "Fix stack use-after-scope in async_safe_log." 2023-03-16 00:43:01 +00:00
Peter Collingbourne
84979776d0 Fix stack use-after-scope in async_safe_log.
The buffer filled in by strerror_r needs to stay in scope while
it is pointed to by str.

Bug: 273807460
Change-Id: I494ca8b8aca2b28ec2f0f3da72d845db99633553
2023-03-15 15:21:58 -07:00
Christopher Ferris
d86eb8665c Add support for M_PURGE_ALL.
This is a new mallopt option that will force purge absolutely
everything no matter how long it takes to purge.

Wrote a unit test for the new mallopt, and added a test to help
verify that new mallopt parameters do not conflict with each other.

Modified some benchmarks to use this new parameter so that we can
get better RSS data.

Added a new M_PURGE_ALL benchmark.

Bug: 243851006

Test: All unit tests pass.
Test: Ran changed benchmarks.
Change-Id: I1b46a5e6253538108e052d11ee46fd513568adec
2023-03-13 19:55:32 -07:00
Zijun Zhao
f6f8315747 Merge "Nullability check for getopt module" 2023-03-13 18:04:20 +00:00
zijunzhao
1581f63e6d Nullability check for getopt module
Bugs: b/245972273
Test: adb shell
Change-Id: I01cab7eacee486348fd90bd2a0d34c41873c017a
2023-03-13 18:03:29 +00:00
Zijun Zhao
e718f8b912 Merge "Nullability check for mntent module" 2023-03-13 18:02:39 +00:00
Treehugger Robot
0a9fd0e77e Merge "Nullability check for signalfd module" 2023-03-13 17:38:38 +00:00
Yi Kong
9b4cf9733f Workaround boot loop by turning off stack protector check for noreturn calls
clang-r487747 added stack protector capability to check noreturn calls.
This caused the system to boot loop. Turn off the new capabilities as a
temporary workaround.

Test: build and boot
Change-Id: I62c912619dfdd2384672d504ce5d52330bf2a102
2023-03-12 19:45:55 +09:00
zijunzhao
424cb2cbfd Nullability check for mntent module
Bugs: b/245972273
Test: adb shell
Change-Id: I8cbf1960c162c1def670b016663fbf10c2f8cb93
2023-03-11 01:52:28 +00:00
zijunzhao
98f116b319 Nullability check for signalfd module
Bugs: b/245972273
Test: adb shell
Change-Id: I47efddc9c0e217fcb29b3f4f1e2d30f27b23c05f
2023-03-11 01:51:02 +00:00
Treehugger Robot
1cccc1a059 Merge "Nullability check for resolv module" 2023-03-11 01:26:13 +00:00
zijunzhao
e589574d22 Nullability check for thread module
Bugs: b/245972273
Test: adb shell
Change-Id: Id93d0456e063adf0d41483a1f99f66c2d67bd4df
2023-03-10 20:37:27 +00:00
zijunzhao
16c23883bd Nullability check for resolv module
Bugs: b/245972273
Test: adb shell
Change-Id: I3ee948b3c832ece1969453d499e6f5de5d0bd85e
2023-03-10 01:40:04 +00:00
Elliott Hughes
d2e55dd05b Merge "The syscall call uses the 'tail' instruction call" 2023-03-09 22:03:42 +00:00
caowencheng
c42c74138c The syscall call uses the 'tail' instruction call
If the 'j' command is used here,it cannot always be called.
The 'tail' command is used here, let the compiler decide
which instruction to use,when the call distance is less
than 1M, it will be compiled into 'j' command, and when
the distance is greater than 1M, it will be compiled
into 'aupic' and 'jr' command.

Test: llvm-objdump -d
Change-Id: I53d8aa7f54b9c4c96fce491487dcba7b63348219
Signed-off-by: caowencheng <caowencheng@eswincomputing.com>
2023-03-09 07:44:03 +00:00
Zijun Zhao
7f8133dc2f Merge "Nullability check for pidfd module" 2023-03-09 00:06:12 +00:00