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 38ee337f45)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user