OSDN Git Service

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)
committerMartijn Coenen <maco@android.com>
Thu, 20 Jul 2017 13:49:52 +0000 (15:49 +0200)
commit76b376eac7a2e9584afb58af87d5451f55b82e3d
treee5d9dd579bf7a080b4e33f7c16a5a944225acb0d
parent89ce9d97e661ee44741bd1ab471c4d9a8a27d077
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