Commit graph

10889 commits

Author SHA1 Message Date
Treehugger Robot
5742addf96 Merge "Nullability check for inttypes module" 2023-01-11 02:38:35 +00:00
zijunzhao
6daedb7c41 Nullability check for inttypes module
Bugs: b/245972273
Test: None
Change-Id: Ibc6edd389a9f7cb4d2d5f625ba67163eeda98979
2023-01-11 00:32:16 +00:00
Florian Mayer
eae797db66 Merge "Plumb scudo_ring_buffer_size to debuggerd_process_info" 2023-01-10 21:23:33 +00:00
Greg Kaiser
2335213e04 Match argument order in cpp file
We swap the 2nd and 3rd arguments to the CallocEntry constructor
to match the order in the cpp file, and match the C calloc convention.

We also fix an invocation of this constructor.

Change-Id: Iebe16d82a74459e5e957c1d9e2cc1aebb15150d0
Test: TreeHugger
2023-01-09 21:14:18 +00:00
Chia-hung Duan
08af69ab7f Merge "Add the timestamps for each alloc data" 2023-01-08 01:23:56 +00:00
Treehugger Robot
57c8646f59 Merge "Nullability check for malloc module." 2023-01-07 01:28:42 +00:00
zijunzhao
979d39cb82 Nullability check for syslog module.
Bugs: b/245972273
Test: None
Change-Id: I630597ac2101e16f5566208019a9a54e78fe5667
2023-01-06 20:22:58 +00:00
Florian Mayer
347dc623ec Plumb scudo_ring_buffer_size to debuggerd_process_info
This is a no-op but will be used in upcoming scudo changes that allow to
change the buffer size at process startup time, and as such we will no
longer be able to call __scudo_get_ring_buffer_size in debuggerd.

Bug: 263287052
Change-Id: I18f166fc136ac8314d748eb80a806defcc25c9fd
2023-01-05 14:07:22 -08:00
Chia-hung Duan
f7e8b17dc5 Add the timestamps for each alloc data
With timestamps, we are able to tell the details of allocator
performance such as the average time for malloc() in different size
class, the potential contention time by examing the overlap between
operations, .etc.

Not all malloc et al. operations are recorded with timestamp. Only
operations relates to memory usage change will have them.

Test: All unit tests pass.

Change-Id: I5c2016246a6f10b221387001bb44778969bb26ae
2023-01-05 22:05:42 +00:00
Treehugger Robot
47fc44c73c Merge "Nullability check for time module." 2023-01-05 21:01:55 +00:00
Treehugger Robot
c22ef226a3 Merge "Merge librust_baremetal_defaults into its library" 2023-01-05 20:01:06 +00:00
zijunzhao
e620266d1c Nullability check for time module.
Bugs: b/245972273
Test: None
Change-Id: I65adc146f88bbd948f61d2f22bdec344faba09ae
2023-01-05 00:18:18 +00:00
Chih-hung Hsieh
2b76f88282 Merge "Disable clang-tidy for upstream files." 2023-01-04 01:22:03 +00:00
Chih-Hung Hsieh
e343db3f54 Disable clang-tidy for upstream files.
Bug: 264302877
Test: presubmit tests; make tidy-bionic_subset
Change-Id: I278201c62e70898103bf20ce8823106418c8fb05
2023-01-03 15:08:22 -08:00
zijunzhao
f043619125 Nullability check for langinfo module.
Bugs: b/245972273
Test: None
Change-Id: I92df36179d25ec668647f15848e5164eeb5d4d70
2023-01-03 19:52:35 +00:00
Pierre-Clément Tosi
3af5799387 Merge librust_baremetal_defaults into its library
Test: m pvmfw_bin
Change-Id: I14e74019fc64865af615d033f508bfb0d71eef2f
2023-01-03 17:57:42 +00:00
Treehugger Robot
6f78f756a2 Merge "Replace __packed with __attribute__((__packed__)) in uapi headers" 2022-12-17 01:49:22 +00:00
Colin Cross
4ac332279d Replace __packed with __attribute__((__packed__)) in uapi headers
Linux uapi headers use __packed as an abbreviation for
__attribute__((__packed__)).  In the upstream kernel headers this
is defined in linux/compiler_attributes.h, but it is not defined
in the uapi headers.  Bionic defines it in sys/cdefs.h, which will
almost always provide the needed definition, but there are uapi
headers that use __packed and do not include any system headers
that would include sys/cdefs.h.  Musl's sys/cdefs.h does not
define __packed, which leads to linker errors when __packed is
treated as a variable name.

Replace __packed with __attribute__((__packed__)) when importing
uapi headers to break the dependency on sys/cdefs.h.

Test: m USE_HOST_MUSL=true on oriole-userdebug in internal master
Change-Id: I45f80f4e5aec868b80ce8eb9d757a3e08ae3e1a9
2022-12-16 11:51:40 -08:00
zijunzhao
1a49058e66 Nullability check for malloc module.
Bugs: b/245972273
Test: None
Change-Id: I33e164c23d5b7d09af003f3d85e02e676b78aa55
2022-12-15 21:47:53 +00:00
Treehugger Robot
65584f3264 Merge "Nullability check for libgen module." 2022-12-15 01:04:20 +00:00
Treehugger Robot
746ed77a29 Merge "Introduce minimal static libc for baremetal Rust" 2022-12-15 00:22:20 +00:00
Christopher Ferris
137ecdd059 Merge "Update to v6.1 kernel headers." 2022-12-14 17:44:45 +00:00
Greg Kaiser
3d6c94f771 Merge "Revert "Remove workarounds for the llvm sanitizers."" 2022-12-13 19:34:50 +00:00
Greg Kaiser
6f02710ad2 Revert "Remove workarounds for the llvm sanitizers."
This reverts commit fa0e022b06.

Reason for revert: Appears to be causing crash_dump crashes in Go and/or 32-bit

Bug: 262391724
Change-Id: I3964aa9d6c7005313e6bf95b7e87d6a2ab08b52d
Test: Local revert on wembley
2022-12-13 17:20:04 +00:00
Pierre-Clément Tosi
74a1458116 Introduce minimal static libc for baremetal Rust
LLVM/rustc compiling no_std code expects a few libc symbols to be
defined (memcpy, memset, memcmp). Previously, we used the arm64 library
directly; instead, make the dependency arch-agnostic by exporting it
from Bionic, making it easier to add more libc functions (that might not
be implemented by the optimized routines), as necessary.

Test: m pvmfw_bin && atest vmbase_example.integration_test
Change-Id: I1d2cc69a25bbb7eddc67357a028b7b79d4909e79
2022-12-13 14:17:50 +00:00
Ryan Prichard
d791a6501e Merge changes I7ba9cef9,Ia191be0b,I16ba3dc8
* changes:
  Expose unwinder APIs in NDK stubs for R and up.
  Use abi::__cxa_demangle declared in cxxabi.h
  __cxa_atexit_test: declare __cxa_atexit and __cxa_finalize
2022-12-13 00:53:40 +00:00
zijunzhao
ab17c07f1e Nullability check for libgen module.
Bugs: b/245972273
Test: None
Change-Id: I41c741701a5b4416a09c3c683a0817b219262c6d
2022-12-13 00:06:09 +00:00
Christopher Ferris
6cd53a5f6b Update to v6.1 kernel headers.
Kernel headers coming from:

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

Test: Bionic unit tests pass.
Change-Id: I9414fb5e698a9806b85eb09e37d763849f08a468
2022-12-12 23:39:16 +00:00
Elliott Hughes
62d8f1a41a Merge "Remove workarounds for the llvm sanitizers." 2022-12-12 22:48:16 +00:00
Elliott Hughes
1287fd978f Merge "Move some cruft from the build system to the source." 2022-12-12 16:05:29 +00:00
Ryan Prichard
fe504afea7 Expose unwinder APIs in NDK stubs for R and up.
These APIs are exposed in the on-device libc.so's .dynsym table from R
and up (e.g. _Unwind_xxx@@LIBC_R), but they were only available in the
APEX and LLNDK stubs. Expose the symbols from the NDK stubs too so that
the LLVM toolchain build can build a libc++.so that imports the
unwinder from libc.so. (The platform/APEX libc++.so will become a
toolchain prebuilt.)

Eventually this change will also allows apps to use the unwinder from
libc.so rather than linking libunwind.a statically.

Bug: http://b/175635923
Test: treehugger
Change-Id: I7ba9cef9a4727b49dd717e25a0321bf2889694de
2022-12-09 16:10:03 -08:00
Ryan Prichard
c2adad1815 Use abi::__cxa_demangle declared in cxxabi.h
Bug: http://b/175635923
Test: treehugger
Change-Id: Ia191be0b4861b011640edc703b55c13c88bce300
2022-12-09 16:10:00 -08:00
Elliott Hughes
8d9549e28a Move some cruft from the build system to the source.
It's more intention-revealing this way round anyway...

Test: treehugger
Change-Id: I561d8ac3003fa6b7f19fcf7110a6646c69bdd936
2022-12-09 19:58:00 +00:00
Elie Kheirallah
056549795c Add rlim64_t to libc/include/sys/resource
crosvm is using rlim64_t. Adding for portability.

Bug: 255594691
Test: m libc && m bionic
Change-Id: I752bfdaa23d900278fe7224306d785b0c9f67d3f
2022-12-08 23:32:11 +00:00
Elliott Hughes
c40ea825e7 Merge "Spring cleaning for the seccomp allowlist." 2022-12-05 15:53:28 +00:00
Elliott Hughes
fa0e022b06 Remove workarounds for the llvm sanitizers.
We shouldn't need to poke these holes in seccomp now we're building the
sanitizers correctly.

Bug: http://b/229989971
Test: cuttlefish still boots with nothing untoward in the log
Change-Id: I2f9a050a86e670f000f44ad266ffdf404f3a1d1a
2022-12-02 22:20:22 +00:00
zijunzhao
5a918d922b Nullability check for stdlib module.
Bugs: b/245972273
Test: None

Change-Id: Ib33a5359a924c21888f268158c4d7f824740dd55
2022-12-02 21:00:02 +00:00
Elliott Hughes
f9941705aa Spring cleaning for the seccomp allowlist.
Remove copy_file_range(2), preadv2(2), and pwritev2(2), all of which are
now in SYSCALLS.TXT.

Remove semtimedop_time64(2) since it doesn't make any sense to have an
exception for just the 64-bit-time_t-on-LP32 variant of a syscall we
don't even use --- this is the least likely variant of that syscall
to need an exception!

Also clean up the unnecessary foo:foo syntax (you only need the : if you
want the generated stub to have a different name, and here the names
were all identical _and_ the whole point of this file is to list
syscalls that we're not generating stubs for, this was doubly useless),
simplify the signatures to just the types (which is all we need), and
improve some of the commentary.

Test: treehugger
Change-Id: I691b5758a2165be9bbeafdd83f0c64d7eea987e5
2022-12-02 20:18:35 +00:00
Elliott Hughes
1e59e2a88d fcntl: remove some duplication, fix a bug.
Treehugger didn't test 32-bit (and neither, of course, had I), so we
didn't notice until the next day that I'd only added the new check to
the 64-bit codepath. Let's just unify the two, since there's only one
line of meaningful difference.

Bug: http://b/261092827
Test: treehugger
Change-Id: I5178257a76fe24a340b3659c85ad29ed0a7b8b50
2022-12-02 02:56:50 +00:00
Elliott Hughes
008aa172d4 Merge "Add some missing "Available since" documentation." 2022-12-01 16:21:58 +00:00
Elliott Hughes
dfe67d266c Tell people when they've messed up with fcntl(FD_SETFD).
This is a subtle bug that even experts struggle with.

Test: treehugger
Change-Id: If9cf16a1c32c836f5688bb3374cfd21d55125b17
2022-11-30 20:19:22 +00:00
Elliott Hughes
d4fd67ce69 Add some missing "Available since" documentation.
Also fix formatting of `errno` in one function.

Test: treehugger
Change-Id: Ibf362bcd36c901dab2a422afe09e0f78011315aa
2022-11-30 19:55:32 +00:00
Elliott Hughes
023e4e7840 Move to arm-optimized-routines memset().
This one's a bit simpler, because there is only one upstream memset()
implementation.

Test: treehugger
Change-Id: I2536d0eb72adaacfa6a0e40d2bd29fc833988c16
2022-11-17 19:28:06 +00:00
Elliott Hughes
7daf4596b7 Switch to the arm-optimized-routines memcpy() and memmove().
Outsource this to them, and choose the best of the two options available
based on the hardware we're running on.

Test: treehugger
Change-Id: I2fa7555c971b64a6decca132210e901ffa248efa
2022-11-17 00:38:49 +00:00
Treehugger Robot
d26d3c0b5c Merge "Implement __memset_chk as a copy & paste of __memcpy_chk." 2022-11-16 23:33:14 +00:00
Treehugger Robot
6c599e3a67 Merge "Move memcpy_base.S into memcpy.S." 2022-11-16 22:11:53 +00:00
Elliott Hughes
3cc366d3a2 Implement __memset_chk as a copy & paste of __memcpy_chk.
These two will stay behind when we move memcpy()/memmove()/memset() over
to arm-optimized-routines (which leaves fortify to us).

Test: treehugger
Change-Id: Ie683f71a5a141263ce3f4e8811df9eaf667584f4
2022-11-16 21:07:56 +00:00
Elliott Hughes
d5ac40cc9f Move memcpy_base.S into memcpy.S.
Just to make it clear that there's nothing interesting going on here ---
there's just one user, and the only symbol here is __memcpy().

Test: treehugger
Change-Id: I62d72c43c4c6d30442f05c1e08a0cb1a1ec42a8a
2022-11-16 18:50:54 +00:00
Elliott Hughes
0d4d276253 Remove assembler wmemmove().
The compiler turns our C wmemmove() into one shift instruction and a
branch, which is plenty for a function no-one uses anyway.

Why don't I just leave this alone, since we already have it? Because I'm
looking at finishing the project of "switch to arm-optimized-routines"
and getting rid of our assembler here, and Arm agrees that this isn't
worth having optimized assembler for in their optimized assembler
project, judging by its absence.

Test: treehugger
Change-Id: I985801241a8cbd7dbda51a447946affb1402effb
2022-11-16 18:44:56 +00:00
Treehugger Robot
9874c54c93 Merge "Nullability check for regex module." 2022-11-12 09:56:56 +00:00