ANDROID: binder: don't check prio permissions on restore.
authorMartijn Coenen <maco@android.com>
Fri, 26 May 2017 17:48:56 +0000 (10:48 -0700)
committerDanny Wood <danwood76@gmail.com>
Tue, 26 Feb 2019 16:35:28 +0000 (16:35 +0000)
commitdadba0f5d83bd25fa78dd9dbb05a5bfee5f9f709
tree1ee4a4810300ee693d965ab308d7b2197a4f3530
parent66266ad30a020f49475d7a0577a170a8766863a0
ANDROID: binder: don't check prio permissions on restore.

Because we have disabled RT priority inheritance for
the regular binder domain, the following can happen:

1) thread A (prio 98) calls into thread B
2) because RT prio inheritance is disabled, thread B
   runs at the lowest nice (prio 100) instead
3) thread B calls back into A; A will run at prio 100
   for the duration of the transaction
4) When thread A is done with the call from B, we will
   try to restore the prio back to 98. But, we fail
   because the process doesn't hold CAP_SYS_NICE,
   neither is RLIMIT_RT_PRIO set.

While the proper fix going forward will be to
correctly apply CAP_SYS_NICE or RLIMIT_RT_PRIO,
for now it seems reasonable to not check permissions
on the restore path.

Change-Id: Ibede5960c9b7bb786271c001e405de50be64d944
Signed-off-by: Martijn Coenen <maco@android.com>
drivers/android/binder.c