diff --git a/debuggerd/crash_dump.cpp b/debuggerd/crash_dump.cpp index 77d4a07af..1c1fb8a59 100644 --- a/debuggerd/crash_dump.cpp +++ b/debuggerd/crash_dump.cpp @@ -449,7 +449,16 @@ static bool GetGuestRegistersFromCrashedProcess([[maybe_unused]] pid_t tid, if (ptrace(PTRACE_GETREGSET, tid, NT_ARM_TLS, &pt_iov) != 0) { PLOG(ERROR) << "failed to read thread register for thread " << tid; + return false; } +#elif defined(__riscv) + struct user_regs_struct regs; + struct iovec pt_iov = {.iov_base = ®s, .iov_len = sizeof(regs)}; + if (ptrace(PTRACE_GETREGSET, tid, NT_PRSTATUS, &pt_iov) != 0) { + PLOG(ERROR) << "failed to read thread register for thread " << tid; + return false; + } + base = reinterpret_cast(regs.tp); #else // TODO(b/339287219): Add case for Riscv host. return false; diff --git a/fs_mgr/libsnapshot/include/libsnapshot/cow_compress.h b/fs_mgr/libsnapshot/include/libsnapshot/cow_compress.h index 21dc6667a..635a38c52 100644 --- a/fs_mgr/libsnapshot/include/libsnapshot/cow_compress.h +++ b/fs_mgr/libsnapshot/include/libsnapshot/cow_compress.h @@ -17,6 +17,8 @@ #pragma once #include +#include + #include "libsnapshot/cow_format.h" namespace android { @@ -50,4 +52,4 @@ class ICompressor { const uint32_t block_size_; }; } // namespace snapshot -} // namespace android \ No newline at end of file +} // namespace android diff --git a/fs_mgr/libsnapshot/include/libsnapshot/cow_reader.h b/fs_mgr/libsnapshot/include/libsnapshot/cow_reader.h index 3f49c69a8..3389f5863 100644 --- a/fs_mgr/libsnapshot/include/libsnapshot/cow_reader.h +++ b/fs_mgr/libsnapshot/include/libsnapshot/cow_reader.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/init/devices.h b/init/devices.h index 44ce2a920..6da123259 100644 --- a/init/devices.h +++ b/init/devices.h @@ -127,9 +127,6 @@ class DeviceHandler : public UeventHandler { virtual ~DeviceHandler() = default; void HandleUevent(const Uevent& uevent) override; - void ColdbootDone() override; - - std::vector GetBlockDeviceSymlinks(const Uevent& uevent) const; // `androidboot.partition_map` allows associating a partition name for a raw block device // through a comma separated and semicolon deliminated list. For example, @@ -138,11 +135,13 @@ class DeviceHandler : public UeventHandler { static std::string GetPartitionNameForDevice(const std::string& device); private: + void ColdbootDone() override; bool FindPlatformDevice(std::string path, std::string* platform_device_path) const; std::tuple GetDevicePermissions( const std::string& path, const std::vector& links) const; void MakeDevice(const std::string& path, bool block, int major, int minor, const std::vector& links) const; + std::vector GetBlockDeviceSymlinks(const Uevent& uevent) const; void HandleDevice(const std::string& action, const std::string& devpath, bool block, int major, int minor, const std::vector& links) const; void FixupSysPermissions(const std::string& upath, const std::string& subsystem) const; diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp index 5efe2098b..c34cd711e 100644 --- a/libcutils/fs_config.cpp +++ b/libcutils/fs_config.cpp @@ -68,10 +68,6 @@ static const struct fs_path_config android_dirs[] = { { 01771, AID_SYSTEM, AID_MISC, 0, "data/misc" }, { 00775, AID_MEDIA_RW, AID_MEDIA_RW, 0, "data/media/Music" }, { 00775, AID_MEDIA_RW, AID_MEDIA_RW, 0, "data/media" }, - { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest" }, - { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest64" }, - { 00750, AID_ROOT, AID_SHELL, 0, "data/benchmarktest" }, - { 00750, AID_ROOT, AID_SHELL, 0, "data/benchmarktest64" }, { 00775, AID_ROOT, AID_ROOT, 0, "data/preloads" }, { 00771, AID_SYSTEM, AID_SYSTEM, 0, "data" }, { 00755, AID_ROOT, AID_SYSTEM, 0, "mnt" }, @@ -143,12 +139,6 @@ static const struct fs_path_config android_files[] = { { 00644, AID_SYSTEM, AID_SYSTEM, 0, "data/app-private/*" }, { 00644, AID_APP, AID_APP, 0, "data/data/*" }, { 00644, AID_MEDIA_RW, AID_MEDIA_RW, 0, "data/media/*" }, - { 00640, AID_ROOT, AID_SHELL, 0, "data/nativetest/tests.txt" }, - { 00640, AID_ROOT, AID_SHELL, 0, "data/nativetest64/tests.txt" }, - { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest/*" }, - { 00750, AID_ROOT, AID_SHELL, 0, "data/nativetest64/*" }, - { 00750, AID_ROOT, AID_SHELL, 0, "data/benchmarktest/*" }, - { 00750, AID_ROOT, AID_SHELL, 0, "data/benchmarktest64/*" }, { 00600, AID_ROOT, AID_ROOT, 0, "default.prop" }, // legacy { 00600, AID_ROOT, AID_ROOT, 0, "system/etc/prop.default" }, { 00600, AID_ROOT, AID_ROOT, 0, "odm/build.prop" }, // legacy; only for P release diff --git a/rootdir/Android.bp b/rootdir/Android.bp index 108c7c2e7..bd24f22f3 100644 --- a/rootdir/Android.bp +++ b/rootdir/Android.bp @@ -117,3 +117,7 @@ prebuilt_etc { llndk_libraries_txt { name: "llndk.libraries.txt", } + +sanitizer_libraries_txt { + name: "sanitizer.libraries.txt", +} \ No newline at end of file diff --git a/rootdir/Android.mk b/rootdir/Android.mk index 2394b14aa..06e87301d 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -210,26 +210,6 @@ $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/init.environ.rc.in $(hide) sed -i -e 's?%EXPORT_GLOBAL_HWASAN_OPTIONS%?$(EXPORT_GLOBAL_HWASAN_OPTIONS)?g' $@ $(hide) sed -i -e 's?%EXPORT_GLOBAL_SCUDO_ALLOCATION_RING_BUFFER_SIZE%?$(EXPORT_GLOBAL_SCUDO_ALLOCATION_RING_BUFFER_SIZE)?g' $@ -####################################### -# sanitizer.libraries.txt -include $(CLEAR_VARS) -LOCAL_MODULE := sanitizer.libraries.txt -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_PATH := $(TARGET_OUT_ETC) -LOCAL_MODULE_STEM := $(LOCAL_MODULE) -include $(BUILD_SYSTEM)/base_rules.mk -$(LOCAL_BUILT_MODULE): PRIVATE_SANITIZER_RUNTIME_LIBRARIES := \ - $(SANITIZER_STEMS) \ - $(2ND_SANITIZER_STEMS) -$(LOCAL_BUILT_MODULE): - @echo "Generate: $@" - @mkdir -p $(dir $@) - $(hide) echo -n > $@ - $(hide) $(foreach lib,$(PRIVATE_SANITIZER_RUNTIME_LIBRARIES), \ - echo $(lib) >> $@;) - ####################################### # ramdisk_node_list include $(CLEAR_VARS)