diff options
author | Alan Stokes <alanstokes@google.com> | 2018-12-19 09:31:21 +0000 |
---|---|---|
committer | Alan Stokes <alanstokes@google.com> | 2019-01-21 11:58:31 +0000 |
commit | e9d3314dc94d20539e45d952b31531e312bb86b3 (patch) | |
tree | 581f9445d4de2e1a6c58daafcbf89c4bc232a8ba /tests/DexLoggerIntegrationTests/src/cpp/test_executable.cpp | |
parent | 6fee8818700e435c5c4f8aa590259af4dd9e3eae (diff) |
Add logging of dynamic loading of native code.
This uses the SELinux audit messages generated when an untrusted app,
targeting SDK 28 or lower, executes native code from an app data
directory. "Executes" here covers memory mapping a file with execute
permission (including using dl_open) or calling execve.
As with dynamic loading of DEX code we write a hash of the contents of
the file executed to the event log.
The existing unit and integration tests are extended to verify the new
behaviour.
Bug: 111338677
Test: atest -p services/core/java/com/android/server/pm/dex
Change-Id: Ifbb3b338135db413be2cd83b1a8e7499d61d88dd
Diffstat (limited to 'tests/DexLoggerIntegrationTests/src/cpp/test_executable.cpp')
-rw-r--r-- | tests/DexLoggerIntegrationTests/src/cpp/test_executable.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/DexLoggerIntegrationTests/src/cpp/test_executable.cpp b/tests/DexLoggerIntegrationTests/src/cpp/test_executable.cpp new file mode 100644 index 000000000000..ad025e696dec --- /dev/null +++ b/tests/DexLoggerIntegrationTests/src/cpp/test_executable.cpp @@ -0,0 +1,20 @@ +/* + * Copyright 2019 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. + */ + +int main() { + // This program just has to run, it doesn't need to do anything. So we don't. + return 0; +} |