CHROMIUM: android: binder: Fix potential scheduling-while-atomic
authorAndrew Bresticker <abrestic@chromium.org>
Fri, 23 Oct 2015 22:13:42 +0000 (15:13 -0700)
committerStricted <info@stricted.net>
Thu, 11 Oct 2018 16:12:57 +0000 (18:12 +0200)
commit0e13ca5f2efc20fb5edf1985f0fe724f037923f5
treef1d3c6efec0596b00482bbbb77f9bd4004a8aa5b
parentd999e7058bcb8c932a9bfc2f00c5a462d1179737
CHROMIUM: android: binder: Fix potential scheduling-while-atomic

(cherry picked from commit 166b45af97359159f9585a836c9849e725e31fd6)

Commit f1e7f0a724f6 ("android: binder: Disable preemption while holding
the global binder lock.") re-enabled preemption around most of the sites
where calls to potentially sleeping functions were made, but missed
__alloc_fd(), which can sleep if the fdtable needs to be resized.
Re-enable preemption around __alloc_fd() as well as __fd_install() which
can now sleep in upstream kernels as of commit 8a81252b774b ("fs/file.c:
don't acquire files->file_lock in fd_install()").

BUG=chrome-os-partner:44012
TEST=Build and boot on Smaug.

Change-Id: I9819c4b95876f697e75b1b84810b6c520d9c33ec
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/308582
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Riley Andrews <riandrews@google.com>
Bug: 30141999
drivers/android/binder.c