summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tim Murray <timmurray@google.com> 2016-08-18 11:13:26 -0700
committer Adam Seaton <aseaton@google.com> 2016-08-20 23:48:24 +0000
commitd72b26085cda620d211e841b0aa3a0738d8ccc34 (patch)
treee52fc10fe37165648b1312e3e53f50e663c1caac
parentb78a9bc5fea443c1a826888321fed5e06ee0c5d6 (diff)
DO NOT MERGE ANYWHERE (nyc-dr1-dev) Prevent FIFO threads from creating more FIFO threads.
SCHED_FIFO threads shouldn't be able to arbitrarily create more SCHED_FIFO threads. bug 30898724 Change-Id: I3704b47b88b573313e9b1610556648c8595d4108 (cherry picked from commit 38ee337f45953cb3ecfc4ab170c639afe01606d1)
-rw-r--r--services/core/java/com/android/server/os/SchedulingPolicyService.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/os/SchedulingPolicyService.java b/services/core/java/com/android/server/os/SchedulingPolicyService.java
index f98012b39a86..62c9f4c116c2 100644
--- a/services/core/java/com/android/server/os/SchedulingPolicyService.java
+++ b/services/core/java/com/android/server/os/SchedulingPolicyService.java
@@ -55,7 +55,8 @@ public class SchedulingPolicyService extends ISchedulingPolicyService.Stub {
Process.setThreadGroup(tid, Binder.getCallingPid() == pid ?
Process.THREAD_GROUP_AUDIO_SYS : Process.THREAD_GROUP_AUDIO_APP);
// must be in this order or it fails the schedulability constraint
- Process.setThreadScheduler(tid, Process.SCHED_FIFO, prio);
+ Process.setThreadScheduler(tid, Process.SCHED_FIFO | Process.SCHED_RESET_ON_FORK,
+ prio);
} catch (RuntimeException e) {
return PackageManager.PERMISSION_DENIED;
}