mirror of
https://github.com/chromium/crashpad.git
synced 2025-01-13 16:58:04 +08:00
Mitch Phillips
fca8871ca3
Add SA_EXPOSE_TAGBITS to crashpad's signal handler.
SA_EXPOSE_TAGBITS is a Linux >= 5.11 feature that allows si_addr to contain the upper tag bits. This is a feature that allows signal handlers to see the full upper address bits on aarch64, which consist of TBI and MTE nibbles. For MTE, preserving these bits is of significant importance, as it allows for precise use-after-free and buffer-overflow diagnosis that's impossible without seeing these bits in the fault address. We unconditionally enable this feature on all kernels, as it's ignored when unsupported (even on older kernels). Tested on: 1. Linux x86 host, which is a no-op. 2. Android device with Linux 4.14, which is a no-op. 3. Android device with Linux 5.15, which passes. For posterity, my config was: | $ gn args out_arm64 | target_os = "android" | android_ndk_root = "~/Android.sdk/ndk/21.4.7075529" | android_api_level = 26 | target_cpu = "arm64" | # NDK builds push libc++_shared.so, which is not present on newer Android | # versions, so I hacked the runner to push the file. Maybe this should be | # upstreamed at some point as well. | $ git diff | diff --git a/build/run_tests.py b/build/run_tests.py | index 8ad19e34..64269c90 100755 | --- a/build/run_tests.py | +++ b/build/run_tests.py | @@ -273,7 +273,8 @@ def _RunOnAndroidTarget(binary_dir, test, android_device, extra_command_line): | _adb_shell(adb_mkdir_command) | | # Push the test binary and any other build output to the device. | - local_test_build_artifacts = [] | + local_test_build_artifacts = [ | + '~/Android.sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so'] | for artifact in test_build_artifacts: | local_test_build_artifacts.append(os.path.join( | binary_dir, artifact)) | @@ -294,6 +295,7 @@ def _RunOnAndroidTarget(binary_dir, test, android_device, extra_command_line): | # The list of TERM values comes from Google Test’s | # googletest/src/gtest.cc testing::internal::ShouldUseColor(). | env = {'CRASHPAD_TEST_DATA_ROOT': device_temp_dir} | + env = {'LD_LIBRARY_PATH': device_out_dir} | gtest_color = os.environ.get('GTEST_COLOR') | if gtest_color in ('auto', None): | if (sys.stdout.isatty() and | $ ninja -C out_arm64 && python build/run_tests.py out_arm64/ \ | --gtest_filter=*StartHandlerForSelfTestSuite* Change-Id: I293b36fcd08ffaca593dae8042299a39756defa0 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4024204 Reviewed-by: Joshua Peraza <jperaza@chromium.org> Commit-Queue: Mitch Phillips <mitchp@google.com>
Crashpad
Crashpad is a crash-reporting system.
Documentation
- Project status
- Developing Crashpad: instructions for getting the source code, building, testing, and contributing to the project.
- Crashpad interface documentation
- Crashpad tool man pages
- Crashpad overview design
Source Code
Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.
Other Links
- Bugs can be reported at the Crashpad issue tracker.
- The Crashpad bots perform automated builds and tests.
- crashpad-dev is the Crashpad developers’ mailing list.
Description
Languages
C++
92.6%
Objective-C++
2.5%
C
2%
Python
1.7%
Assembly
0.9%
Other
0.3%