2024-06-19 23:57:56 -04:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2024-06-19 16:19:28 -04:00
|
|
|
From: Hans Boehm <hboehm@google.com>
|
|
|
|
Date: Tue, 2 Jan 2024 16:53:13 -0800
|
|
|
|
Subject: [PATCH] Check hidden API exemptions
|
|
|
|
|
|
|
|
Refuse to deal with newlines and null characters in
|
|
|
|
HiddenApiSettings.update(). Also disallow nulls in process start
|
|
|
|
arguments.
|
|
|
|
|
|
|
|
Bug: 316153291
|
|
|
|
Test: Treehugger for now
|
|
|
|
(cherry picked from commit 7ba059e2cf0a2c20f9a849719cdc32b12c933a44)
|
|
|
|
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:60669aa49aba34c0950d6246bd95b54f91a3c8e8)
|
|
|
|
Merged-In: I83cd60e46407a4a082f9f3c80e937dbd522dbac4
|
|
|
|
Change-Id: I83cd60e46407a4a082f9f3c80e937dbd522dbac4
|
|
|
|
---
|
|
|
|
core/java/android/os/ZygoteProcess.java | 2 ++
|
|
|
|
1 file changed, 2 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/core/java/android/os/ZygoteProcess.java b/core/java/android/os/ZygoteProcess.java
|
2024-06-19 23:57:56 -04:00
|
|
|
index d3eb9ae05fe4..69d54b766d29 100644
|
2024-06-19 16:19:28 -04:00
|
|
|
--- a/core/java/android/os/ZygoteProcess.java
|
|
|
|
+++ b/core/java/android/os/ZygoteProcess.java
|
2024-06-19 23:57:56 -04:00
|
|
|
@@ -267,6 +267,8 @@ public class ZygoteProcess {
|
2024-06-19 16:19:28 -04:00
|
|
|
throw new ZygoteStartFailedEx("Embedded newlines not allowed");
|
|
|
|
} else if (args.get(i).indexOf('\r') >= 0) {
|
|
|
|
throw new ZygoteStartFailedEx("Embedded carriage returns not allowed");
|
|
|
|
+ } else if (args.get(i).indexOf('\u0000') >= 0) {
|
|
|
|
+ throw new ZygoteStartFailedEx("Embedded nulls not allowed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|