summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alan Stokes <alanstokes@google.com> 2023-04-06 14:21:08 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-04-06 14:21:08 +0000
commit39d5b7d4adc94d2df1308e3cf0bf2c1a205d6d60 (patch)
tree3b606b90bf918cc7de0898639c203cda21144b5e
parent599082490c8c9d510b3ada3f82679e55cef1cfe3 (diff)
parente89b9e89f519cab5742681851234006a4a7ae1df (diff)
Merge "Make AVC log parsing less strict" am: de8dd4aabb am: 71b946c62d am: e89b9e89f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2527285 Change-Id: I466adb873905309e6f5e8c841bd252a6e797d7f4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--services/core/java/com/android/server/pm/DynamicCodeLoggingService.java2
-rw-r--r--tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/pm/DynamicCodeLoggingService.java b/services/core/java/com/android/server/pm/DynamicCodeLoggingService.java
index cae7079c75e0..82b585d7ad01 100644
--- a/services/core/java/com/android/server/pm/DynamicCodeLoggingService.java
+++ b/services/core/java/com/android/server/pm/DynamicCodeLoggingService.java
@@ -65,7 +65,7 @@ public class DynamicCodeLoggingService extends JobService {
private static final String AVC_PREFIX = "type=" + AUDIT_AVC + " ";
private static final Pattern EXECUTE_NATIVE_AUDIT_PATTERN =
- Pattern.compile(".*\\bavc: granted \\{ execute(?:_no_trans|) \\} .*"
+ Pattern.compile(".*\\bavc: +granted +\\{ execute(?:_no_trans|) \\} .*"
+ "\\bpath=(?:\"([^\" ]*)\"|([0-9A-F]+)) .*"
+ "\\bscontext=u:r:untrusted_app(?:_25|_27)?:.*"
+ "\\btcontext=u:object_r:app_data_file:.*"
diff --git a/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java b/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java
index cfebf3462b57..4299e0d616fb 100644
--- a/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java
+++ b/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java
@@ -87,7 +87,7 @@ public final class DynamicCodeLoggerIntegrationTests {
// avoid flakiness we run these tests multiple times, allowing progressively longer between
// code loading and checking the logs on each try.)
private static final int AUDIT_LOG_RETRIES = 10;
- private static final int RETRY_DELAY_MS = 2_000;
+ private static final int RETRY_DELAY_MS = 500;
private static Context sContext;
private static int sMyUid;
@@ -253,7 +253,7 @@ public final class DynamicCodeLoggerIntegrationTests {
"/DynamicCodeLoggerNativeExecutable", privateCopyFile);
EventLog.writeEvent(EventLog.getTagCode("auditd"),
- "type=1400 avc: granted { execute_no_trans } "
+ "type=1400 avc: granted { execute_no_trans } "
+ "path=\"" + privateCopyFile + "\" "
+ "scontext=u:r:untrusted_app: "
+ "tcontext=u:object_r:app_data_file: "