mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 23:48:30 +00:00
On a bramble device, observed a crash in the VTS binary itself when
executing BoringSSL signature verification code locally (i.e. with no
KeyMaster interaction involved).
The crash call stack involves CFI checks, and seems to occur at the
point when some BoringSSL digest calculation code invokes a function
pointer.
- SHA1_Update passes &sha1_block_data_order to (inlined)...
- crypto_md32_update() which invokes the function pointer
via its block_func parameter.
Moving the BoringSSL dependency from static_libs: libcrypto_static to
shared_libs: libcrypto makes the crash go away, but a smaller change
that also fixes the problem is to disable CFI checks for the test
binary.
This approach was inspired by:
ab65cd0e89%5E%21/#F0
The same problem looks to be relevant for the bugs listed below.
Bug: 206496340
Bug: 206498742
Test: VtsHalKeymasterV4_0TargetTest --gtest_filter="*VerificationOperationsTest.RsaAllPaddingsAndDigests*"
Change-Id: I12b145dad5535846d68c97954d31a93123bb95e7
64 lines
1.7 KiB
Plaintext
64 lines
1.7 KiB
Plaintext
//
|
|
// Copyright (C) 2017 The Android Open Source Project
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
//
|
|
|
|
package {
|
|
// See: http://go/android-license-faq
|
|
// A large-scale-change added 'default_applicable_licenses' to import
|
|
// all of the 'license_kinds' from "hardware_interfaces_license"
|
|
// to get the below license kinds:
|
|
// SPDX-license-identifier-Apache-2.0
|
|
default_applicable_licenses: ["hardware_interfaces_license"],
|
|
}
|
|
|
|
cc_test {
|
|
name: "VtsHalKeymasterV4_0TargetTest",
|
|
defaults: ["VtsHalTargetTestDefaults"],
|
|
srcs: [
|
|
"HmacKeySharingTest.cpp",
|
|
"VerificationTokenTest.cpp",
|
|
"keymaster_hidl_hal_test.cpp",
|
|
],
|
|
static_libs: [
|
|
"android.hardware.keymaster@4.0",
|
|
"libcrypto_static",
|
|
"libkeymaster4support",
|
|
"libkeymaster4vtstest",
|
|
],
|
|
test_suites: [
|
|
"general-tests",
|
|
"vts",
|
|
],
|
|
sanitize: {
|
|
cfi: false,
|
|
},
|
|
|
|
}
|
|
|
|
cc_test_library {
|
|
name: "libkeymaster4vtstest",
|
|
defaults: ["VtsHalTargetTestDefaults"],
|
|
srcs: [
|
|
"KeymasterHidlTest.cpp",
|
|
],
|
|
export_include_dirs: [
|
|
".",
|
|
],
|
|
static_libs: [
|
|
"android.hardware.keymaster@4.0",
|
|
"libkeymaster4support",
|
|
],
|
|
}
|